****************************************************************
***** this do-file replicates the figures and tables in the appendix
****************************************************************

cd "~/Wilfahrt_APSR Replication Data"

use "Data/APSR_Data_Final.dta", clear

ssc install acreg
ssc install ranktest
findit zscore

label var grid_perc_h20 "\% Water"
label var landsuitability "Agr. Suit."
label var elevation "Elev."
label var Rugged_RuggednessFinal "Ruggedness"
label var mt_binary_mean "Mountainous"
label var malaria_2000 "Malaria Suit"
label var grid_longitude "Long"
label var grid_latitude "Lat"
label var Centralized_uncertaintyMAX "Max Uncertainty"
label var Centralized_uncertaintyMIN "Min Uncertainty"
label var Polity_8hr_ttl_area_km "Polity Ttl Area (km2)"

label var CHIRPS_Prec_mm "Prec (mm)"
label var landsuitability "Agr. Suitability"
label var elevation "Elevation"
label var Rugged_RuggednessFinal "Ruggedness"
label var mt_binary_mean "Mountainous"
label var malaria_2000 "Malaria Index"
label var Centralized_8hr "Centralized 8hr"
label var D_Coast_km "D Coast (km)"
label var Centralized_8hr "Centralization, 8hr"
label var NaturalResources_Dummy "Natural Resources"
label var ln_dist_capital_km_pre2011 "ln D Capital (km)"
label var ln_d_coast_km "ln D Coast (km)"
label var popdensity_0ad "Pop Density 0AD"
label var ln_popdensity_0ad "ln Pop Density 0AD"
label var dist_capital_km_pre2011 "D Capital km"
label var ln_dist_capital_km_pre2011 "ln D Capital (km)"
label var Eco_Diversity "Eco. Diversity"
label var Min_D_State_Indep "D State Independence (km)" 

global pretreatment ln_popdensity_0ad Eco_Diversity landsuitability ln_d_coast_km NaturalResources_Dummy grid_perc_h20 elevation Rugged_RuggednessFinal mt_binary_mean
global posttreatment ln_CHIRPS_Prec_mm malaria_2000 ln_dist_capital_km_pre2011 Min_D_State_Indep
global posttreatment_post2011 ln_CHIRPS_Prec_mm malaria_2000 ln_dist_capital_km Min_D_State_Indep

d $pretreatment
d $posttreatment 
d $posttreatment_post2011 

drop if Counterfactual == 0


*** SECTION 3.4 Atlas in Comparison with Other Measures
{
* Table A3.4a: Bauer et al’s Universe of Cases
use "Data/APSR_Data_Final.dta", clear
sort grid_id
merge grid_id using "Data/Appendix/Comparison_Other Measures/Grid_10km_Bauer.dta"
drop _merge
replace Centralized_8hr_Bauer = 0 if Bauer_State == ""
gen State_Type_8hr_Bauer = 0
replace State_Type_8hr_Bauer = 4 if Bauer_State == "aussa"  | Bauer_State == "swaziland"   | Bauer_State == "baguirmi"  | Bauer_State == "bornu" | Bauer_State == "buganda" | Bauer_State == "bunyoro" | Bauer_State == "dahomey"  | Bauer_State == "solomonic" | Bauer_State == "darfur" | Bauer_State == "igala" | Bauer_State == "kuba" | Bauer_State == "ngoyo"  | Bauer_State == "ankole"   | Bauer_State == "rwanda" | Bauer_State == "mazrui" | Bauer_State == "loango" 
replace State_Type_8hr_Bauer = 3 if  Bauer_State == "burundi" | Bauer_State == "shamba"  | Bauer_State == "zande" |  Bauer_State == "kong" | Bauer_State ==  "wassoulou"   | Bauer_State == "sotho" | Bauer_State == "merina" |  Bauer_State == "toucouleur" | Bauer_State == "masina" | Bauer_State == "benin"   | Bauer_State == "ondo" | Bauer_State == "oyo" | Bauer_State == "funj" | Bauer_State == "karagwe" | Bauer_State == "tooro"  | Bauer_State == "gyaman" 
replace State_Type_8hr_Bauer = 2 if  Bauer_State == "zulu" | Bauer_State == "kazembe"  | Bauer_State == "bamana"  | Bauer_State == "sokoto"  | Bauer_State == "wolof"  | Bauer_State == "mossi" | Bauer_State == "lunda" | Bauer_State == "rozwi" | Bauer_State == "luba" | Bauer_State == "kom" | Bauer_State == "bamum" | Bauer_State == "futa jallon" | Bauer_State == "kaabu" | Bauer_State == "maravi" | Bauer_State == "kasanje" | Bauer_State == "nri"  | Bauer_State == "anziku"   | Bauer_State == "menabe" | Bauer_State == "boina" 
replace State_Type_8hr_Bauer = 1 if Bauer_State == "asanti" | Bauer_State == "futa toro" | Bauer_State == "ijebu" 

drop if Counterfactual == 0

reg ln_Agg_Acled_pre2013 Centralized_8hr_Bauer     $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store ln_agAcled
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_conflict_Acled_pre2013 Centralized_8hr_Bauer  $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id) 
	est store ln_YrsAcled
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_Battles_State_pre2013 Centralized_8hr_Bauer   $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store lnNBattle
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_StateConflicts_pre2013 Centralized_8hr_Bauer   $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store lnNConflict
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_Stateconflict_pre2013 Centralized_8hr_Bauer $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store lnYrsConflict
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"

reg nightlight_20132_mean Centralized_8hr_Bauer $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store Mean2013
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_mean2013 Centralized_8hr_Bauer $pretreatment c.grid_longitude#c.grid_latitude, cluster(grid0_5_id)
	est store ln_Mean2013
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg rwi Centralized_8hr_Bauer $pretreatment c.grid_longitude#c.grid_latitude, cluster(grid0_5_id)
	est store rwi
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg EWI_Index Centralized_8hr_Bauer $pretreatment c.grid_longitude#c.grid_latitude, cluster(grid0_5_id)
	est store ewi
	estadd local  LL  "Yes"		
	estadd local  CN  "Yes"

* Table A3.5a: Bauer et al’s Universe of Cases
reg ln_Agg_Acled_pre2013 i.State_Type_8hr_Bauer   $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id) 
	est store ln_agAcled
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_conflict_Acled_pre2013 i.State_Type_8hr_Bauer   $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store ln_YrsAcled
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_Battles_State_pre2013 i.State_Type_8hr_Bauer   $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store lnNBattle
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_StateConflicts_pre2013 i.State_Type_8hr_Bauer   $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store lnNConflict
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_Stateconflict_pre2013 i.State_Type_8hr_Bauer   $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store lnYrsConflict
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"

	
reg nightlight_20132_mean i.State_Type_8hr_Bauer  $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store Mean2013
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_mean2013  i.State_Type_8hr_Bauer  $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store ln_Mean2013
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg rwi i.State_Type_8hr_Bauer $pretreatment c.grid_longitude#c.grid_latitude, cluster(grid0_5_id)
	est store rwi
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg EWI_Index i.State_Type_8hr_Bauer $pretreatment c.grid_longitude#c.grid_latitude, cluster(grid0_5_id)
	est store ewi
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"

		
esttab ln_agAcled ln_YrsAcled lnNBattle lnNConflict lnYrsConflict Mean2013 ln_Mean2013 rwi ewi using "Data/Table Output/Type_Bauer.tex", replace ///
	scalars(r2 "Geo Coords" "CN Pretreatment Vars") modelwidth(2) se b(3) star (* 0.1 ** 0.05 *** 0.001) drop( $pretreatment  grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Model Results: Type Centralization - Bauer et al. Universe of Cases"\label{Type_Bauer}) nonumbers compress  ///
	mtitles("ln Acled Battles" "ln ACLED Yrs Conflict" "ln UCDP Battles" "ln # UCDP Conflicts" "ln UCDP Yrs Conflict" "Mean Nightlights" "ln Mean Nightlights" "Relative Wealth" "Estimated Wealth")

	
* Table A3.4b: Paine et al.’s Universe of Cases
use "Data/APSR_Data_Final.dta", clear
sort grid_id
merge grid_id using "Data/Appendix/Comparison_Other Measures/Grid_10km_Paine_etal.dta"
drop _merge
replace Centralized_8hr_Paine = 0 if Paine_State == ""

gen State_Type_8hr_Paine = 0
replace State_Type_8hr_Paine = 4 if Paine_State == "Borno" | Paine_State == "Buganda" | Paine_State == "Bunyoro" | Paine_State == "Dahomey" | Paine_State == "Darfur"   | Paine_State == "Ethiopia" | Paine_State == "Igala" | Paine_State == "Nkore"  | Paine_State == "Rwanda"  | Paine_State == "Swazi" |  Paine_State == "Damagaram" | Paine_State == "Lozi" | Paine_State ==  "Sine"
replace State_Type_8hr_Paine = 3 if Paine_State == "Benin" | Paine_State == "Burundi" | Paine_State == "Oyo"  | Paine_State == "Bundu" | Paine_State == "Cayor" | Paine_State == "Dagomba" | Paine_State == "Gaza" | Paine_State == "Gobir" | Paine_State == "Jolof" | Paine_State == "Wadai" | Paine_State ==  "Walo"
replace State_Type_8hr_Paine = 2 if Paine_State == "Futa Jalon" | Paine_State == "Kazembe" | Paine_State == "Kasanje"  | Paine_State == "Lesotho" | Paine_State == "Luba" | Paine_State == "Lunda"  | Paine_State == "Mossi" | Paine_State == "Sokoto" | Paine_State == "Zulu" | Paine_State == "Ndebele" | Paine_State == "Porto Novo" | Paine_State == "Salum"
replace State_Type_8hr_Paine = 1 if Paine_State == "Asante" | Paine_State == "Futa Toro" | Paine_State == "Ijebu" | Paine_State == "Borgu" | Paine_State == "Egba" | Paine_State == "Ibadan"

drop if Counterfactual == 0

reg ln_Agg_Acled_pre2013 Centralized_8hr_Paine     $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store ln_agAcled
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_conflict_Acled_pre2013 Centralized_8hr_Paine  $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id) 
	est store ln_YrsAcled
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_Battles_State_pre2013 Centralized_8hr_Paine   $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store lnNBattle
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_StateConflicts_pre2013 Centralized_8hr_Paine   $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store lnNConflict
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_Stateconflict_pre2013 Centralized_8hr_Paine $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store lnYrsConflict
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"


reg nightlight_20132_mean Centralized_8hr_Paine $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store Mean2013
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_mean2013 Centralized_8hr_Paine $pretreatment c.grid_longitude#c.grid_latitude, cluster(grid0_5_id)
	est store ln_Mean2013
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg rwi Centralized_8hr_Paine $pretreatment c.grid_longitude#c.grid_latitude, cluster(grid0_5_id)
	est store rwi
	estadd local  LL  "Yes"
reg EWI_Index Centralized_8hr_Paine $pretreatment c.grid_longitude#c.grid_latitude, cluster(grid0_5_id)
	est store ewi
	estadd local  LL  "Yes"	
	estadd local  CN  "Yes"
				
esttab ln_agAcled ln_YrsAcled lnNBattle lnNConflict lnYrsConflict Mean2013 ln_Mean2013 rwi ewi using "Data/Table Output/Base_Paine.tex", replace ///
	scalars(r2 "Geo Coords" "CN Pretreatment Vars") modelwidth(2) se b(3) star (* 0.1 ** 0.05 *** 0.001) drop( $pretreatment  grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Model Results: Base Centralization - Paine et al. Universe of Cases"\label{Base_Paine}) nonumbers compress  ///
	mtitles("ln Acled Battles" "ln ACLED Yrs Conflict" "ln UCDP Battles" "ln # UCDP Conflicts" "ln UCDP Yrs Conflict" "Mean Nightlights" "ln Mean Nightlights" "Relative Wealth" "Estimated Wealth")

* Table A3.5b: Paine et al.’s Universe of Cases	
reg ln_Agg_Acled_pre2013 i.State_Type_8hr_Paine   $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id) 
	est store ln_agAcled
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_conflict_Acled_pre2013 i.State_Type_8hr_Paine   $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store ln_YrsAcled
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_Battles_State_pre2013 i.State_Type_8hr_Paine   $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store lnNBattle
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_StateConflicts_pre2013 i.State_Type_8hr_Paine   $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store lnNConflict
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_Stateconflict_pre2013 i.State_Type_8hr_Paine   $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store lnYrsConflict
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"

	
reg nightlight_20132_mean i.State_Type_8hr_Paine  $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store Mean2013
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_mean2013  i.State_Type_8hr_Paine  $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store ln_Mean2013
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg rwi i.State_Type_8hr_Paine $pretreatment c.grid_longitude#c.grid_latitude, cluster(grid0_5_id)
	est store rwi
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg EWI_Index i.State_Type_8hr_Paine $pretreatment c.grid_longitude#c.grid_latitude, cluster(grid0_5_id)
	est store ewi
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
			
esttab ln_agAcled ln_YrsAcled lnNBattle lnNConflict lnYrsConflict Mean2013 ln_Mean2013 rwi ewi using "Data/Table Output/Type_Paine.tex", replace ///
	scalars(r2 "Geo Coords" "CN Pretreatment Vars") modelwidth(2) se b(3) star (* 0.1 ** 0.05 *** 0.001) drop( $pretreatment  grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Model Results: Type Centralization - Paine et al. Universe of Cases"\label{Type_Paine}) nonumbers compress  ///
	mtitles("ln Acled Battles" "ln ACLED Yrs Conflict" "ln UCDP Battles" "ln # UCDP Conflicts" "ln UCDP Yrs Conflict" "Mean Nightlights" "ln Mean Nightlights" "Relative Wealth" "Estimated Wealth")
}


*** TABLE A3.6: Ecological and Geographic Covariates of Statehood
{
use "Data/APSR_Data_Final.dta", clear
drop if Counterfactual == 0

eststo acephalous: quietly estpost summarize ///
        Eco_Diversity landsuitability  NaturalResources_Dummy  popdensity_0ad  elevation Rugged_RuggednessFinal  mt_binary_mean D_Coast_km   CHIRPS_Prec_mm malaria_2000 grid_longitude grid_latitude  if Centralized_8hr == 0
eststo centralized: quietly estpost summarize ///
	Eco_Diversity landsuitability  NaturalResources_Dummy  popdensity_0ad  elevation Rugged_RuggednessFinal  mt_binary_mean D_Coast_km  CHIRPS_Prec_mm  malaria_2000 grid_longitude grid_latitude  if Centralized_8hr == 1

esttab acephalous centralized using "Data/Table Output/Drivers_Centralization.tex", replace ///
cells("mean(pattern(1 1 1 1 1) fmt(2))") ///
label title("Ecological and Geographic Covariates of Centralization"\label{Drivers_Centralization}) nonumbers mtitles(Acephalous Centralized) 

ttest landsuitability, by(Centralized_8hr)
ttest NaturalResources_Dummy, by(Centralized_8hr)
ttest Eco_Diversity, by(Centralized_8hr)
ttest popdensity_0ad, by(Centralized_8hr)
ttest CHIRPS_Prec_mm, by(Centralized_8hr)
ttest elevation, by(Centralized_8hr)
ttest Rugged_RuggednessFinal, by(Centralized_8hr)
ttest mt_binary_mean, by(Centralized_8hr)
ttest D_Coast_km, by(Centralized_8hr)
ttest malaria_2000, by(Centralized_8hr)
ttest grid_longitude, by(Centralized_8hr)
ttest grid_latitude, by(Centralized_8hr)
}


*** TABLE A4.1: Summary Statistics by State Type at Grid Cell Level
{
* Outcome variables
eststo acephalous: quietly estpost summarize ///
     ln_Agg_Acled_pre2013 ln_N_yrs_conflict_Acled_pre2013 ln_N_Battles_State_pre2013 ln_N_StateConflicts_pre2013 ln_N_yrs_Stateconflict_pre2013 nightlight_20132_mean ln_mean2013 rwi EWI_Index if Polity_Type_8hr == 0
eststo Fed: quietly estpost summarize ///
     ln_Agg_Acled_pre2013 ln_N_yrs_conflict_Acled_pre2013 ln_N_Battles_State_pre2013 ln_N_StateConflicts_pre2013 ln_N_yrs_Stateconflict_pre2013 nightlight_20132_mean ln_mean2013 rwi EWI_Index if Polity_Type_8hr == 1
eststo Gate: quietly estpost summarize ///
     ln_Agg_Acled_pre2013 ln_N_yrs_conflict_Acled_pre2013 ln_N_Battles_State_pre2013 ln_N_StateConflicts_pre2013 ln_N_yrs_Stateconflict_pre2013 nightlight_20132_mean ln_mean2013 rwi EWI_Index if Polity_Type_8hr == 2
eststo Regal: quietly estpost summarize ///
     ln_Agg_Acled_pre2013 ln_N_yrs_conflict_Acled_pre2013 ln_N_Battles_State_pre2013 ln_N_StateConflicts_pre2013 ln_N_yrs_Stateconflict_pre2013 nightlight_20132_mean ln_mean2013 rwi EWI_Index if Polity_Type_8hr == 3
eststo Desp: quietly estpost summarize ///
     ln_Agg_Acled_pre2013 ln_N_yrs_conflict_Acled_pre2013 ln_N_Battles_State_pre2013 ln_N_StateConflicts_pre2013 ln_N_yrs_Stateconflict_pre2013 nightlight_20132_mean ln_mean2013 rwi EWI_Index if Polity_Type_8hr == 4

esttab acephalous Fed Gate Regal Desp using "Data/Table Output/SumStats_Dvs.tex", replace ///
cells("mean(pattern(1 1 1 1 1) fmt(2))") ///
label title("Summary Statistics of Outcome Varibles by Polity Type at Grid Level"\label{SumStats}) nonumbers mtitles(Uncentralized Federation Gatekeeper Regal Despotic) 

* covariates
eststo acephalous: quietly estpost summarize ///
    D_Coast_km  dist_capital_km_pre2011 Min_D_State_Indep  malaria_2000 Eco_Diversity CHIRPS_Prec_mm popdensity_0ad  NaturalResources_Dummy landsuitability elevation Rugged_RuggednessFinal  mt_binary_mean grid_perc_h20 grid_longitude grid_latitude  if Polity_Type_8hr == 0
eststo Fed: quietly estpost summarize ///
    D_Coast_km  dist_capital_km_pre2011 Min_D_State_Indep  malaria_2000 Eco_Diversity  CHIRPS_Prec_mm popdensity_0ad  NaturalResources_Dummy landsuitability elevation Rugged_RuggednessFinal  mt_binary_mean grid_perc_h20 grid_longitude grid_latitude  if Polity_Type_8hr == 1
eststo Gate: quietly estpost summarize ///
    D_Coast_km  dist_capital_km_pre2011 Min_D_State_Indep  malaria_2000 Eco_Diversity CHIRPS_Prec_mm  popdensity_0ad  NaturalResources_Dummy landsuitability elevation Rugged_RuggednessFinal  mt_binary_mean grid_perc_h20  grid_longitude grid_latitude  if Polity_Type_8hr == 2
eststo Regal: quietly estpost summarize ///
    D_Coast_km   dist_capital_km_pre2011 Min_D_State_Indep  malaria_2000 Eco_Diversity  CHIRPS_Prec_mm popdensity_0ad  NaturalResources_Dummy landsuitability elevation Rugged_RuggednessFinal  mt_binary_mean grid_perc_h20  grid_longitude grid_latitude  if Polity_Type_8hr == 3
eststo Desp: quietly estpost summarize ///
    D_Coast_km  dist_capital_km_pre2011 Min_D_State_Indep  malaria_2000 Eco_Diversity  CHIRPS_Prec_mm popdensity_0ad  NaturalResources_Dummy landsuitability elevation Rugged_RuggednessFinal  mt_binary_mean grid_perc_h20  grid_longitude grid_latitude  if Polity_Type_8hr == 4

esttab acephalous Fed Gate Regal Desp using "Data/Table Output/SumStats.tex", replace ///
cells("mean(pattern(1 1 1 1 1) fmt(2))") ///
label title("Summary Statistics of Geographic Covariates by Polity Type at Grid Level"\label{SumStats}) nonumbers mtitles(Uncentralized Federation Gatekeeper Regal Despotic) 
}


*** SECTION 5: Full Model Results
{
* Table A5.1: Conflict Outcomes - Base Statehood
reg ln_Agg_Acled_pre2013 Centralized_8hr  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store ln_agAcled1
	estadd local  CN  "No"
	estadd local  LL  "Yes"
	estadd local  PTCN  "No"
reg ln_Agg_Acled_pre2013 Centralized_8hr $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store ln_agAcled2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  PTCN  "No"
reg ln_Agg_Acled_pre2013 Centralized_8hr $pretreatment  $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_agAcled3
	estadd local  CN  "Yes"
	estadd local  LL  "Yes"
	estadd local  PTCN  "Yes"
	
reg ln_N_yrs_conflict_Acled_pre2013 Centralized_8hr  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store ln_YrsAcled1
	estadd local  CN  "No"
	estadd local  LL  "Yes"
	estadd local  PTCN  "No"
reg ln_N_yrs_conflict_Acled_pre2013 Centralized_8hr $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store ln_YrsAcled2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  PTCN  "No"
reg ln_N_yrs_conflict_Acled_pre2013 Centralized_8hr $pretreatment  $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_YrsAcled3
	estadd local  CN  "Yes"
	estadd local  LL  "Yes"
	estadd local  PTCN  "Yes"
	
reg ln_N_Battles_State_pre2013 Centralized_8hr  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store lnNBattle1
	estadd local  CN  "No"
	estadd local  LL  "Yes"
	estadd local  PTCN  "No"
reg ln_N_Battles_State_pre2013 Centralized_8hr $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store lnNBattle2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  PTCN  "No"
reg ln_N_Battles_State_pre2013 Centralized_8hr $pretreatment  $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNBattle3
	estadd local  CN  "Yes"
	estadd local  LL  "Yes"
	estadd local  PTCN  "Yes"

reg ln_N_StateConflicts_pre2013 Centralized_8hr  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store lnNConflict1
	estadd local  CN  "No"
	estadd local  LL  "Yes"
	estadd local  PTCN  "No"
reg ln_N_StateConflicts_pre2013 Centralized_8hr $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store lnNConflict2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  PTCN  "No"
reg ln_N_StateConflicts_pre2013 Centralized_8hr $pretreatment  $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNConflict3
	estadd local  CN  "Yes"
	estadd local  LL  "Yes"
	estadd local  PTCN  "Yes"
	
reg ln_N_yrs_Stateconflict_pre2013 Centralized_8hr  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store lnYrsConflict1
	estadd local  CN  "No"
	estadd local  LL  "Yes"
	estadd local  PTCN  "No"
reg ln_N_yrs_Stateconflict_pre2013 Centralized_8hr $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store lnYrsConflict2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  PTCN  "No"
reg ln_N_yrs_Stateconflict_pre2013 Centralized_8hr $pretreatment  $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnYrsConflict3
	estadd local  CN  "Yes"
	estadd local  LL  "Yes"
	estadd local  PTCN  "Yes"

esttab ln_agAcled1 ln_agAcled2 ln_agAcled3 ln_YrsAcled1 ln_YrsAcled2 ln_YrsAcled3 lnNBattle1 lnNBattle2 lnNBattle3 lnNConflict1 lnNConflict2 lnNConflict3 lnYrsConflict1 lnYrsConflict2 lnYrsConflict3 using "Data/Table Output/Conflict_Base_Full.tex", replace ///
	scalars(r2 "LL Geog. Coordinates" "CN Pretreatment Vars" "PTCN Posttreatment controls") modelwidth(2) se b(3) star(* 0.1 ** 0.05 *** 0.001) drop(grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Model Results"\label{Base_Conflict}) nonumbers compress  ///
	mtitles("ln Acled Battles" "ln ACLED Yrs Conflict" "ln UCDP Battles" "ln # UCDP Conflicts" "ln UCDP Yrs Conflict")

	
* Table A5.2: Development Outcomes - Base Statehood
reg nightlight_20132_mean Centralized_8hr  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store Mean20131
	estadd local  CN  "No"
	estadd local  LL  "Yes"
	estadd local  PTCN  "No"
reg nightlight_20132_mean Centralized_8hr $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store Mean20132
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  PTCN  "No"
reg nightlight_20132_mean Centralized_8hr $pretreatment  $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store Mean20133
	estadd local  CN  "Yes"
	estadd local  LL  "Yes"
	estadd local  PTCN  "Yes"
	
reg ln_mean2013 Centralized_8hr  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store ln_Mean20131
	estadd local  CN  "No"
	estadd local  LL  "Yes"
	estadd local  PTCN  "No"
reg ln_mean2013 Centralized_8hr $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store ln_Mean20132
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  PTCN  "No"
reg ln_mean2013 Centralized_8hr $pretreatment  $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_Mean20133
	estadd local  CN  "Yes"
	estadd local  LL  "Yes"
	estadd local  PTCN  "Yes"
	
reg rwi Centralized_8hr  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store rwi1
	estadd local  CN  "No"
	estadd local  LL  "Yes"
	estadd local  PTCN  "No"
reg rwi Centralized_8hr $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store rwi2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  PTCN  "No"
reg rwi Centralized_8hr $pretreatment  $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store rwi3
	estadd local  CN  "Yes"
	estadd local  LL  "Yes"
	estadd local  PTCN  "Yes"

reg EWI_Index Centralized_8hr  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store ewi1
	estadd local  CN  "No"
	estadd local  LL  "Yes"
	estadd local  PTCN  "No"
reg EWI_Index Centralized_8hr $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store ewi2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  PTCN  "No"
reg EWI_Index Centralized_8hr $pretreatment  $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ewi3
	estadd local  CN  "Yes"
	estadd local  LL  "Yes"
	estadd local  PTCN  "Yes"
	
esttab Mean20131 Mean20132 Mean20133 ln_Mean20131 ln_Mean20132 ln_Mean20133 rwi1 rwi2 rwi3 ewi1 ewi2 ewi3 using "Data/Table Output/Dev_All_Full.tex", replace ///
	scalars(r2 "LL Geog. Coordinates" "CN Pretreatment Vars" "PTCN Posttreatment controls") modelwidth(2) se b(3) star (* 0.1 ** 0.05 *** 0.001) drop(grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Model Results"\label{Base_Dev}) nonumbers compress  ///
	mtitles("Mean Nightlights" "ln Mean Nightlights" "RWI" "EWD")
	
	
* Table A5.3: Conflict Outcomes - State Type
reg ln_Agg_Acled_pre2013  Type_2 Type_3 Type_4 Type_5   c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store ln_agAcled1
	estadd local  CN  "No"
	estadd local  LL  "Yes"
	estadd local  PTCN  "No"
reg ln_Agg_Acled_pre2013  Type_2 Type_3 Type_4 Type_5  $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store ln_agAcled2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  PTCN  "No"
reg ln_Agg_Acled_pre2013  Type_2 Type_3 Type_4 Type_5  $pretreatment  $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_agAcled3
	estadd local  CN  "Yes"
	estadd local  LL  "Yes"
	estadd local  PTCN  "Yes"
	
reg ln_N_yrs_conflict_Acled_pre2013  Type_2 Type_3 Type_4 Type_5   c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store ln_YrsAcled1
	estadd local  CN  "No"
	estadd local  LL  "Yes"
	estadd local  PTCN  "No"
reg ln_N_yrs_conflict_Acled_pre2013  Type_2 Type_3 Type_4 Type_5  $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store ln_YrsAcled2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  PTCN  "No"
reg ln_N_yrs_conflict_Acled_pre2013  Type_2 Type_3 Type_4 Type_5  $pretreatment  $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_YrsAcled3
	estadd local  CN  "Yes"
	estadd local  LL  "Yes"
	estadd local  PTCN  "Yes"
	
reg ln_N_Battles_State_pre2013  Type_2 Type_3 Type_4 Type_5   c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store lnNBattle1
	estadd local  CN  "No"
	estadd local  LL  "Yes"
	estadd local  PTCN  "No"
reg ln_N_Battles_State_pre2013  Type_2 Type_3 Type_4 Type_5  $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store lnNBattle2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  PTCN  "No"
reg ln_N_Battles_State_pre2013  Type_2 Type_3 Type_4 Type_5  $pretreatment  $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNBattle3
	estadd local  CN  "Yes"
	estadd local  LL  "Yes"
	estadd local  PTCN  "Yes"

reg ln_N_StateConflicts_pre2013  Type_2 Type_3 Type_4 Type_5   c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store lnNConflict1
	estadd local  CN  "No"
	estadd local  LL  "Yes"
	estadd local  PTCN  "No"
reg ln_N_StateConflicts_pre2013  Type_2 Type_3 Type_4 Type_5  $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store lnNConflict2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  PTCN  "No"
reg ln_N_StateConflicts_pre2013  Type_2 Type_3 Type_4 Type_5  $pretreatment  $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNConflict3
	estadd local  CN  "Yes"
	estadd local  LL  "Yes"
	estadd local  PTCN  "Yes"
	
reg ln_N_yrs_Stateconflict_pre2013  Type_2 Type_3 Type_4 Type_5   c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store lnYrsConflict1
	estadd local  CN  "No"
	estadd local  LL  "Yes"
	estadd local  PTCN  "No"
reg ln_N_yrs_Stateconflict_pre2013  Type_2 Type_3 Type_4 Type_5  $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store lnYrsConflict2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  PTCN  "No"
reg ln_N_yrs_Stateconflict_pre2013  Type_2 Type_3 Type_4 Type_5  $pretreatment  $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnYrsConflict3
	estadd local  CN  "Yes"
	estadd local  LL  "Yes"
	estadd local  PTCN  "Yes"

esttab ln_agAcled1 ln_agAcled2 ln_agAcled3 ln_YrsAcled1 ln_YrsAcled2 ln_YrsAcled3 lnNBattle1 lnNBattle2 lnNBattle3 lnNConflict1 lnNConflict2 lnNConflict3 lnYrsConflict1 lnYrsConflict2 lnYrsConflict3 using "Data/Table Output/Conflict_Type_All_Full.tex", replace ///
	scalars(r2 "LL Geog. Coordinates" "CN Pretreatment Vars" "PTCN Posttreatment controls") modelwidth(2) se b(3) star (* 0.1 ** 0.05 *** 0.001) drop(grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Model Results"\label{Base_Conflict}) nonumbers compress  ///
	mtitles("ln Acled Battles" "ln ACLED Yrs Conflict" "ln UCDP Battles" "ln # UCDP Conflicts" "ln UCDP Yrs Conflict")

	
* Table A5.4: Development Outcomes - State Type
reg nightlight_20132_mean  Type_2 Type_3 Type_4 Type_5   c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store Mean20131
	estadd local  CN  "No"
	estadd local  LL  "Yes"
	estadd local  PTCN  "No"
reg nightlight_20132_mean  Type_2 Type_3 Type_4 Type_5  $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store Mean20132
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  PTCN  "No"
reg nightlight_20132_mean  Type_2 Type_3 Type_4 Type_5  $pretreatment  $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store Mean20133
	estadd local  CN  "Yes"
	estadd local  LL  "Yes"
	estadd local  PTCN  "Yes"
	
reg ln_mean2013  Type_2 Type_3 Type_4 Type_5   c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store ln_Mean20131
	estadd local  CN  "No"
	estadd local  LL  "Yes"
	estadd local  PTCN  "No"
reg ln_mean2013  Type_2 Type_3 Type_4 Type_5  $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store ln_Mean20132
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  PTCN  "No"
reg ln_mean2013  Type_2 Type_3 Type_4 Type_5  $pretreatment  $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_Mean20133
	estadd local  CN  "Yes"
	estadd local  LL  "Yes"
	estadd local  PTCN  "Yes"
	
reg rwi  Type_2 Type_3 Type_4 Type_5   c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store rwi1
	estadd local  CN  "No"
	estadd local  LL  "Yes"
	estadd local  PTCN  "No"
reg rwi  Type_2 Type_3 Type_4 Type_5  $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store rwi2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  PTCN  "No"
reg rwi  Type_2 Type_3 Type_4 Type_5  $pretreatment  $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store rwi3
	estadd local  CN  "Yes"
	estadd local  LL  "Yes"
	estadd local  PTCN  "Yes"

reg EWI_Index  Type_2 Type_3 Type_4 Type_5   c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store ewi1
	estadd local  CN  "No"
	estadd local  LL  "Yes"
	estadd local  PTCN  "No"
reg EWI_Index  Type_2 Type_3 Type_4 Type_5  $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store ewi2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  PTCN  "No"
reg EWI_Index  Type_2 Type_3 Type_4 Type_5  $pretreatment  $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ewi3
	estadd local  CN  "Yes"
	estadd local  LL  "Yes"
	estadd local  PTCN  "Yes"
	
esttab Mean20131 Mean20132 Mean20133 ln_Mean20131 ln_Mean20132 ln_Mean20133 rwi1 rwi2 rwi3 ewi1 ewi2 ewi3 using "Data/Table Output/Dev_Type_All_Full.tex", replace ///
	scalars(r2 "LL Geog. Coordinates" "CN Pretreatment Vars" "PTCN Posttreatment controls") modelwidth(2) se b(3) star (* 0.1 ** 0.05 *** 0.001) drop(grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Model Results"\label{Base_Dev}) nonumbers compress  ///
	mtitles("Mean Nightlights" "ln Mean Nightlights" "RWI" "EWD")
}


*** SECTION 6.1: State Types Controlling for Statehood
{
* Table A6.1: Conflict Outcomes - State Type Controlling for Statehood
reg ln_Agg_Acled_pre2013  Centralized_8hr  Type_3 Type_4 Type_5   c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store ln_agAcled1
	estadd local  CN  "No"
	estadd local  LL  "Yes"
	estadd local  PTCN  "No"
reg ln_Agg_Acled_pre2013  Centralized_8hr  Type_3 Type_4 Type_5  $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store ln_agAcled2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  PTCN  "No"
reg ln_Agg_Acled_pre2013  Centralized_8hr  Type_3 Type_4 Type_5  $pretreatment  $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_agAcled3
	estadd local  CN  "Yes"
	estadd local  LL  "Yes"
	estadd local  PTCN  "Yes"
	
reg ln_N_yrs_conflict_Acled_pre2013  Centralized_8hr  Type_3 Type_4 Type_5   c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store ln_YrsAcled1
	estadd local  CN  "No"
	estadd local  LL  "Yes"
	estadd local  PTCN  "No"
reg ln_N_yrs_conflict_Acled_pre2013  Centralized_8hr  Type_3 Type_4 Type_5  $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store ln_YrsAcled2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  PTCN  "No"
reg ln_N_yrs_conflict_Acled_pre2013  Centralized_8hr  Type_3 Type_4 Type_5  $pretreatment  $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_YrsAcled3
	estadd local  CN  "Yes"
	estadd local  LL  "Yes"
	estadd local  PTCN  "Yes"
	
reg ln_N_Battles_State_pre2013  Centralized_8hr  Type_3 Type_4 Type_5   c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store lnNBattle1
	estadd local  CN  "No"
	estadd local  LL  "Yes"
	estadd local  PTCN  "No"
reg ln_N_Battles_State_pre2013  Centralized_8hr  Type_3 Type_4 Type_5  $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store lnNBattle2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  PTCN  "No"
reg ln_N_Battles_State_pre2013  Centralized_8hr  Type_3 Type_4 Type_5  $pretreatment  $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNBattle3
	estadd local  CN  "Yes"
	estadd local  LL  "Yes"
	estadd local  PTCN  "Yes"

reg ln_N_StateConflicts_pre2013  Centralized_8hr  Type_3 Type_4 Type_5   c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store lnNConflict1
	estadd local  CN  "No"
	estadd local  LL  "Yes"
	estadd local  PTCN  "No"
reg ln_N_StateConflicts_pre2013  Centralized_8hr  Type_3 Type_4 Type_5  $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store lnNConflict2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  PTCN  "No"
reg ln_N_StateConflicts_pre2013  Centralized_8hr  Type_3 Type_4 Type_5  $pretreatment  $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNConflict3
	estadd local  CN  "Yes"
	estadd local  LL  "Yes"
	estadd local  PTCN  "Yes"
	
reg ln_N_yrs_Stateconflict_pre2013  Centralized_8hr  Type_3 Type_4 Type_5   c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store lnYrsConflict1
	estadd local  CN  "No"
	estadd local  LL  "Yes"
	estadd local  PTCN  "No"
reg ln_N_yrs_Stateconflict_pre2013  Centralized_8hr  Type_3 Type_4 Type_5  $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store lnYrsConflict2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  PTCN  "No"
reg ln_N_yrs_Stateconflict_pre2013  Centralized_8hr  Type_3 Type_4 Type_5  $pretreatment  $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnYrsConflict3
	estadd local  CN  "Yes"
	estadd local  LL  "Yes"
	estadd local  PTCN  "Yes"

esttab ln_agAcled1 ln_agAcled2 ln_agAcled3 ln_YrsAcled1 ln_YrsAcled2 ln_YrsAcled3 lnNBattle1 lnNBattle2 lnNBattle3 lnNConflict1 lnNConflict2 lnNConflict3 lnYrsConflict1 lnYrsConflict2 lnYrsConflict3 using "Data/Table Output/TypeResults_Conflict_FedBase.tex", replace ///
	scalars(r2 "LL Geog. Coordinates" "CN Pretreatment Vars" "PTCN Posttreatment controls") modelwidth(2) se b(3) star (* 0.1 ** 0.05 *** 0.001) drop(grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Model Results"\label{Base_Conflict}) nonumbers compress  ///
	mtitles("ln Acled Battles" "ln ACLED Yrs Conflict" "ln UCDP Battles" "ln # UCDP Conflicts" "ln UCDP Yrs Conflict")

* Table A6.2: Development Outcomes - State Type Controlling for Statehood
reg nightlight_20132_mean  Centralized_8hr  Type_3 Type_4 Type_5   c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store Mean20131
	estadd local  CN  "No"
	estadd local  LL  "Yes"
	estadd local  PTCN  "No"
reg nightlight_20132_mean  Centralized_8hr  Type_3 Type_4 Type_5  $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store Mean20132
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  PTCN  "No"
reg nightlight_20132_mean  Centralized_8hr  Type_3 Type_4 Type_5  $pretreatment  $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store Mean20133
	estadd local  CN  "Yes"
	estadd local  LL  "Yes"
	estadd local  PTCN  "Yes"
	
reg ln_mean2013  Centralized_8hr  Type_3 Type_4 Type_5   c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store ln_Mean20131
	estadd local  CN  "No"
	estadd local  LL  "Yes"
	estadd local  PTCN  "No"
reg ln_mean2013  Centralized_8hr  Type_3 Type_4 Type_5  $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store ln_Mean20132
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  PTCN  "No"
reg ln_mean2013  Centralized_8hr  Type_3 Type_4 Type_5  $pretreatment  $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_Mean20133
	estadd local  CN  "Yes"
	estadd local  LL  "Yes"
	estadd local  PTCN  "Yes"
	
reg rwi  Centralized_8hr  Type_3 Type_4 Type_5   c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store rwi1
	estadd local  CN  "No"
	estadd local  LL  "Yes"
	estadd local  PTCN  "No"
reg rwi  Centralized_8hr  Type_3 Type_4 Type_5  $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store rwi2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  PTCN  "No"
reg rwi  Centralized_8hr  Type_3 Type_4 Type_5  $pretreatment  $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store rwi3
	estadd local  CN  "Yes"
	estadd local  LL  "Yes"
	estadd local  PTCN  "Yes"

reg EWI_Index  Centralized_8hr  Type_3 Type_4 Type_5   c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store ewi1
	estadd local  CN  "No"
	estadd local  LL  "Yes"
	estadd local  PTCN  "No"
reg EWI_Index  Centralized_8hr  Type_3 Type_4 Type_5  $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store ewi2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  PTCN  "No"
reg EWI_Index  Centralized_8hr  Type_3 Type_4 Type_5  $pretreatment  $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ewi3
	estadd local  CN  "Yes"
	estadd local  LL  "Yes"
	estadd local  PTCN  "Yes"
	
esttab Mean20131 Mean20132 Mean20133 ln_Mean20131 ln_Mean20132 ln_Mean20133 rwi1 rwi2 rwi3 ewi1 ewi2 ewi3 using "Data/Table Output/TypeResults_Dev_FedBase.tex", replace ///
	scalars(r2 "LL Geog. Coordinates" "CN Pretreatment Vars" "PTCN Posttreatment controls") modelwidth(2) se b(3) star (* 0.1 ** 0.05 *** 0.001) drop(grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Model Results"\label{Base_Dev}) nonumbers compress  ///
	mtitles("Mean Nightlights" "ln Mean Nightlights" "RWI" "EWD")
}


*** TABLE A6.3: Model Results: Controlling for Polity Size
{
reg ln_Agg_Acled_pre2013 Type_3  Type_4 Type_5   Polity_8hr_ttl_area_km   $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store ln_agAcled_type
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"

reg ln_N_yrs_conflict_Acled_pre2013  Type_3 Type_4 Type_5   Polity_8hr_ttl_area_km   $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_YrsAcled_type
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"

reg ln_N_Battles_State_pre2013 Type_3 Type_4 Type_5   Polity_8hr_ttl_area_km   $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNBattle_type
	estadd local  LL  "Yes"
		estadd local  CN  "Yes"

reg ln_N_StateConflicts_pre2013 Type_3 Type_4 Type_5   Polity_8hr_ttl_area_km   $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNConflict_type
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	
reg ln_N_yrs_Stateconflict_pre2013   Type_3 Type_4 Type_5   Polity_8hr_ttl_area_km   $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnYrsConflict_type
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"

	
reg nightlight_20132_mean Type_3 Type_4 Type_5   Polity_8hr_ttl_area_km   $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store Mean2013_type
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"

reg ln_mean2013 Type_3 Type_4 Type_5   Polity_8hr_ttl_area_km   $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_Mean2013_type
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"

reg rwi  Type_3 Type_4 Type_5   Polity_8hr_ttl_area_km   $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store rwi_type
	estadd local  LL  "Yes"	
	estadd local  CN  "Yes"
	
reg EWI_Index Type_3 Type_4 Type_5   Polity_8hr_ttl_area_km   $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ewi_type
	estadd local  LL  "Yes"	
	estadd local  CN  "Yes"
	
	
esttab ln_agAcled_type  ln_YrsAcled_type  lnNBattle_type  lnNConflict_type  lnYrsConflict_type Mean2013_type  ln_Mean2013_type  rwi_type  ewi_type using "Data/Table Output/StateSize.tex", replace ///
	scalars(r2 "Geo Coords" "CN Pretreatment Vars") modelwidth(2) se b(3) star (* 0.1 ** 0.05 *** 0.001) drop($pretreatment  grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Model Results"\label{Base_Dev}) nonumbers compress  ///
	mtitles("ln Acled Battles" "ln ACLED Yrs Conflict" "ln UCDP Battles" "ln # UCDP Conflicts" "ln UCDP Yrs Conflict" "Mean Nightlights" "ln Mean Nightlights" "RWI" "EWD")
}


*** TABLE A6.5: Conflict Models: Controlling for Historic Conflict
{
sort grid_id
merge grid_id using "Data/Grid Covariates/D_Grid_HistoricalConflict.dta"

drop _merge

gen Polity_Age_8hr2 = .
replace Polity_Age_8hr2 = 1 if Polity_Age_8hr == "0_49yrs"
replace Polity_Age_8hr2 = 2 if Polity_Age_8hr == "50_99yrs"
replace Polity_Age_8hr2 = 3 if Polity_Age_8hr == "100_150yrs"
replace Polity_Age_8hr2 = 4 if Polity_Age_8hr == "150_200yrs"
replace Polity_Age_8hr2 = 5 if Polity_Age_8hr == "200_250yrs"
replace Polity_Age_8hr2 = 6 if Polity_Age_8hr == "250_299yrs"
replace Polity_Age_8hr2 = 7 if Polity_Age_8hr == "300yrsPlus"

tab historicconflict Centralized_8hr, row
tab historicconflict Polity_Type_8hr , row


reg ln_Agg_Acled_pre2013 Centralized_8hr historicconflict $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store ln_agAcled1
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  PTCN  "No"
reg ln_Agg_Acled_pre2013  Type_2 Type_3 Type_4 Type_5 historicconflict $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store ln_agAcled2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  PTCN  "No"
	
reg ln_N_yrs_conflict_Acled_pre2013 Centralized_8hr historicconflict $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store ln_YrsAcled1
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  PTCN  "No"
reg ln_N_yrs_conflict_Acled_pre2013  Type_2 Type_3 Type_4 Type_5 historicconflict  $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store ln_YrsAcled2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  PTCN  "No"

reg ln_N_Battles_State_pre2013 Centralized_8hr historicconflict $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store lnNBattle1
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  PTCN  "No"
reg ln_N_Battles_State_pre2013  Type_2 Type_3 Type_4 Type_5 historicconflict $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNBattle2
	estadd local  CN  "Yes"
	estadd local  LL  "Yes"
	estadd local  PTCN  "Yes"
	
reg ln_N_StateConflicts_pre2013 Centralized_8hr historicconflict $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store lnNConflict1
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  PTCN  "No"
reg ln_N_StateConflicts_pre2013  Type_2 Type_3 Type_4 Type_5 historicconflict $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNConflict2
	estadd local  CN  "Yes"
	estadd local  LL  "Yes"
	estadd local  PTCN  "Yes"
	
reg ln_N_yrs_Stateconflict_pre2013 Centralized_8hr historicconflict $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store lnYrsConflict1
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  PTCN  "No"
reg ln_N_yrs_Stateconflict_pre2013  Type_2 Type_3 Type_4 Type_5 historicconflict  $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnYrsConflict2
	estadd local  CN  "Yes"
	estadd local  LL  "Yes"
	estadd local  PTCN  "Yes"
	
esttab  ln_agAcled1 ln_agAcled2  ln_YrsAcled1 ln_YrsAcled2  lnNBattle1 lnNBattle2  lnNConflict1 lnNConflict2  lnYrsConflict1 lnYrsConflict2 using "Data/Table Output/Conflict_All_Bellicist.tex", replace ///
	scalars(r2 "LL Geog. Coordinates" "CN Pretreatment controls" "PTCN Posttreatment controls") modelwidth(2) b(3) star (* 0.1 ** 0.05 *** 0.001) drop($pretreatment grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Model Results"\label{Base_Conflict_Bellicist}) nonumbers compress  ///
	mtitles("ln Acled Battles" "ln ACLED Yrs Conflict" "ln UCDP Battles" "ln # UCDP Conflicts" "ln UCDP Yrs Conflict")


}

*** SECTION 6.4: Alternative Strategies for Spatial Dependence
{
* Table A6.6: Alternative Approaches to Spatial Dependence: Base Statehood with Clustered Standard Errors at 1 degree
reg ln_Agg_Acled_pre2013 Centralized_8hr     $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid1dg_id)
	est store ln_agAcled
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_conflict_Acled_pre2013 Centralized_8hr  $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid1dg_id) 
	est store ln_YrsAcled
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_Battles_State_pre2013 Centralized_8hr   $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid1dg_id)
	est store lnNBattle
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_StateConflicts_pre2013 Centralized_8hr   $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid1dg_id)
	est store lnNConflict
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_Stateconflict_pre2013 Centralized_8hr $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid1dg_id)
	est store lnYrsConflict
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"

reg nightlight_20132_mean Centralized_8hr $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid1dg_id)
	est store Mean2013
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_mean2013 Centralized_8hr $pretreatment c.grid_longitude#c.grid_latitude, cluster(grid1dg_id)
	est store ln_Mean2013
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg rwi Centralized_8hr $pretreatment c.grid_longitude#c.grid_latitude, cluster(grid1dg_id)
	est store rwi
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg EWI_Index Centralized_8hr $pretreatment c.grid_longitude#c.grid_latitude, cluster(grid1dg_id)
	est store ewi
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"

esttab ln_agAcled ln_YrsAcled lnNBattle lnNConflict lnYrsConflict Mean2013 ln_Mean2013 rwi ewi using "Data/Table Output/Base__1degSE.tex", replace ///
	scalars(r2 "Geo Coords" "CN Pretreatment Vars") modelwidth(2) se b(3) star (* 0.1 ** 0.05 *** 0.001) drop(grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Alternative Approaches to Spatial Dependence: Base Centralization with Clustered Standard Errors at 1 degree (approx 111km)"\label{Base_1degSE}) nonumbers compress  ///
	mtitles("ln Acled Battles" "ln ACLED Yrs Conflict" "ln UCDP Battles" "ln # UCDP Conflicts" "ln UCDP Yrs Conflict" "Mean Nightlights" "ln Mean Nightlights" "RWI" "EWD")

* Table A6.7: Alternative Approaches to Spatial Dependence: State Type with Clustered Standard Errors at 1 degree
reg ln_Agg_Acled_pre2013 i.Polity_Type_8hr   $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid1dg_id) 
	est store ln_agAcled
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_conflict_Acled_pre2013 i.Polity_Type_8hr   $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid1dg_id)
	est store ln_YrsAcled
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_Battles_State_pre2013 i.Polity_Type_8hr   $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid1dg_id)
	est store lnNBattle
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_StateConflicts_pre2013 i.Polity_Type_8hr   $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid1dg_id)
	est store lnNConflict
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_Stateconflict_pre2013 i.Polity_Type_8hr   $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid1dg_id)
	est store lnYrsConflict
	estadd local  CN  "Yes"

reg nightlight_20132_mean i.Polity_Type_8hr  $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid1dg_id)
	est store Mean2013
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_mean2013  i.Polity_Type_8hr  $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid1dg_id)
	est store ln_Mean2013
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg rwi i.Polity_Type_8hr $pretreatment c.grid_longitude#c.grid_latitude, cluster(grid1dg_id)
	est store rwi
	estadd local  CN  "Yes"
	estadd local  LL  "Yes"
reg EWI_Index i.Polity_Type_8hr $pretreatment c.grid_longitude#c.grid_latitude, cluster(grid1dg_id)
	est store ewi
	estadd local  CN  "Yes"
	estadd local  LL  "Yes"
	
esttab ln_agAcled ln_YrsAcled lnNBattle lnNConflict lnYrsConflict Mean2013 ln_Mean2013 rwi ewi using "Data/Table Output/Type__1degSE.tex", replace ///
	scalars(r2 "Geo Coords" "CN Pretreatment Vars") modelwidth(2) se b(3) star (* 0.1 ** 0.05 *** 0.001) drop(grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Alternative Approaches to Spatial Dependence: Base Centralization with Clustered Standard Errors at 1 degree (approx 111km)"\label{Type_1degSE}) nonumbers compress  ///
	mtitles("ln Acled Battles" "ln ACLED Yrs Conflict" "ln UCDP Battles" "ln # UCDP Conflicts" "ln UCDP Yrs Conflict" "Mean Nightlights" "ln Mean Nightlights" "RWI" "EWD")
 

* Table A6.8: Base Model Replications with Conley Standard Errors
drop if grid_latitude == .
* 25km
acreg ln_Agg_Acled_pre2013 Centralized_8hr $pretreatment , spatial latitude(grid_latitude) longitude(grid_longitude) dist(25)
acreg ln_N_yrs_conflict_Acled_pre2013 Centralized_8hr $pretreatment , spatial latitude(grid_latitude) longitude(grid_longitude) dist(25)
acreg ln_N_Battles_State_pre2013 Centralized_8hr $pretreatment , spatial latitude(grid_latitude) longitude(grid_longitude) dist(25)
acreg ln_N_StateConflicts_pre2013 Centralized_8hr $pretreatment , spatial latitude(grid_latitude) longitude(grid_longitude) dist(25)
acreg ln_N_yrs_Stateconflict_pre2013 Centralized_8hr $pretreatment , spatial latitude(grid_latitude) longitude(grid_longitude) dist(25)

acreg nightlight_20132_mean Centralized_8hr    $pretreatment , spatial latitude(grid_latitude) longitude(grid_longitude) dist(25)
acreg ln_mean2013 Centralized_8hr    $pretreatment , spatial latitude(grid_latitude) longitude(grid_longitude) dist(25)
acreg rwi Centralized_8hr    $pretreatment , spatial latitude(grid_latitude) longitude(grid_longitude) dist(25)
acreg EWI_Index Centralized_8hr    $pretreatment , spatial latitude(grid_latitude) longitude(grid_longitude) dist(25)

* 50km
acreg ln_Agg_Acled_pre2013 Centralized_8hr $pretreatment , spatial latitude(grid_latitude) longitude(grid_longitude) dist(50)
acreg ln_N_yrs_conflict_Acled_pre2013 Centralized_8hr $pretreatment , spatial latitude(grid_latitude) longitude(grid_longitude) dist(50)
acreg ln_N_Battles_State_pre2013 Centralized_8hr $pretreatment , spatial latitude(grid_latitude) longitude(grid_longitude) dist(50)
acreg ln_N_StateConflicts_pre2013 Centralized_8hr $pretreatment , spatial latitude(grid_latitude) longitude(grid_longitude) dist(50)
acreg ln_N_yrs_Stateconflict_pre2013 Centralized_8hr $pretreatment , spatial latitude(grid_latitude) longitude(grid_longitude) dist(50)

acreg nightlight_20132_mean Centralized_8hr    $pretreatment , spatial latitude(grid_latitude) longitude(grid_longitude) dist(50)
acreg ln_mean2013 Centralized_8hr    $pretreatment , spatial latitude(grid_latitude) longitude(grid_longitude) dist(50)
acreg rwi Centralized_8hr    $pretreatment  , spatial latitude(grid_latitude) longitude(grid_longitude) dist(50)
acreg EWI_Index Centralized_8hr    $pretreatment  , spatial latitude(grid_latitude) longitude(grid_longitude) dist(50)

* 75km
acreg ln_Agg_Acled_pre2013 Centralized_8hr $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(75)
acreg ln_N_yrs_conflict_Acled_pre2013 Centralized_8hr $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(75)
acreg ln_N_Battles_State_pre2013 Centralized_8hr $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(75)
acreg ln_N_StateConflicts_pre2013 Centralized_8hr $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(75)
acreg ln_N_yrs_Stateconflict_pre2013 Centralized_8hr $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(75)

acreg nightlight_20132_mean Centralized_8hr    $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(75)
acreg ln_mean2013 Centralized_8hr    $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(75)
acreg rwi Centralized_8hr    $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(75)
acreg EWI_Index Centralized_8hr    $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(75)

* 100km
acreg ln_Agg_Acled_pre2013 Centralized_8hr $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(100)
acreg ln_N_yrs_conflict_Acled_pre2013 Centralized_8hr $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(100)
acreg ln_N_Battles_State_pre2013 Centralized_8hr $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(100)
acreg ln_N_StateConflicts_pre2013 Centralized_8hr $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(100)
acreg ln_N_yrs_Stateconflict_pre2013 Centralized_8hr $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(100)

acreg nightlight_20132_mean Centralized_8hr    $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(100)
acreg ln_mean2013 Centralized_8hr    $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(100)
acreg rwi Centralized_8hr    $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(100)
acreg EWI_Index Centralized_8hr    $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(100)


* Table A6.9: State Type Model Replications with Conley Standard Errors
* 25km
acreg ln_Agg_Acled_pre2013 Type_2 Type_3 Type_4 Type_5 $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(25)
acreg ln_N_yrs_conflict_Acled_pre2013 Type_2 Type_3 Type_4 Type_5 $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(25)
acreg ln_N_Battles_State_pre2013 Type_2 Type_3 Type_4 Type_5 $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(25)
acreg ln_N_StateConflicts_pre2013 Type_2 Type_3 Type_4 Type_5 $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(25)
acreg ln_N_yrs_Stateconflict_pre2013 Type_2 Type_3 Type_4 Type_5 $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(25)

acreg nightlight_20132_mean Type_2 Type_3 Type_4 Type_5  $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(25)
acreg ln_mean2013 Type_2 Type_3 Type_4 Type_5  $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(25)
acreg rwi Type_2 Type_3 Type_4 Type_5 $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(25)
acreg EWI_Index Type_2 Type_3 Type_4 Type_5 $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(25)

* 50km
acreg ln_Agg_Acled_pre2013 Type_2 Type_3 Type_4 Type_5 $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(50)
acreg ln_N_yrs_conflict_Acled_pre2013 Type_2 Type_3 Type_4 Type_5 $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(50)
acreg ln_N_Battles_State_pre2013 Type_2 Type_3 Type_4 Type_5 $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(50)
acreg ln_N_StateConflicts_pre2013 Type_2 Type_3 Type_4 Type_5 $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(50)
acreg ln_N_yrs_Stateconflict_pre2013 Type_2 Type_3 Type_4 Type_5 $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(50)

acreg nightlight_20132_mean Type_2 Type_3 Type_4 Type_5  $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(50)
acreg ln_mean2013 Type_2 Type_3 Type_4 Type_5  $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(50)
acreg rwi Type_2 Type_3 Type_4 Type_5 $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(50)
acreg EWI_Index Type_2 Type_3 Type_4 Type_5 $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(50)

* 75km
acreg ln_Agg_Acled_pre2013 Type_2 Type_3 Type_4 Type_5 $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(75)
acreg ln_N_yrs_conflict_Acled_pre2013 Type_2 Type_3 Type_4 Type_5 $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(75)
acreg ln_N_Battles_State_pre2013 Type_2 Type_3 Type_4 Type_5 $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(75)
acreg ln_N_StateConflicts_pre2013 Type_2 Type_3 Type_4 Type_5 $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(75)
acreg ln_N_yrs_Stateconflict_pre2013 Type_2 Type_3 Type_4 Type_5 $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(75)

acreg nightlight_20132_mean Type_2 Type_3 Type_4 Type_5  $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(75)
acreg ln_mean2013 Type_2 Type_3 Type_4 Type_5  $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(75)
acreg rwi Type_2 Type_3 Type_4 Type_5 $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(75)
acreg EWI_Index Type_2 Type_3 Type_4 Type_5 $pretreatment, spatial latitude(grid_latitude) longitude(grid_longitude) dist(75)

* 100km
acreg ln_Agg_Acled_pre2013 Type_2 Type_3 Type_4 Type_5 $pretreatment grid_longitude grid_latitude , spatial latitude(grid_latitude) longitude(grid_longitude) dist(100)
acreg ln_N_yrs_conflict_Acled_pre2013 Type_2 Type_3 Type_4 Type_5 $pretreatment grid_longitude grid_latitude , spatial latitude(grid_latitude) longitude(grid_longitude) dist(100)
acreg ln_N_Battles_State_pre2013 Type_2 Type_3 Type_4 Type_5 $pretreatment grid_longitude grid_latitude , spatial latitude(grid_latitude) longitude(grid_longitude) dist(100)
acreg ln_N_StateConflicts_pre2013 Type_2 Type_3 Type_4 Type_5 $pretreatment grid_longitude grid_latitude , spatial latitude(grid_latitude) longitude(grid_longitude) dist(100)
acreg ln_N_yrs_Stateconflict_pre2013 Type_2 Type_3 Type_4 Type_5 $pretreatment grid_longitude grid_latitude , spatial latitude(grid_latitude) longitude(grid_longitude) dist(100)

acreg nightlight_20132_mean Type_2 Type_3 Type_4 Type_5 $pretreatment grid_longitude grid_latitude , spatial latitude(grid_latitude) longitude(grid_longitude) dist(100)
acreg ln_mean2013 Type_2 Type_3 Type_4 Type_5  $pretreatment grid_longitude grid_latitude , spatial latitude(grid_latitude) longitude(grid_longitude) dist(100)
acreg rwi Type_2 Type_3 Type_4 Type_5  $pretreatment grid_longitude grid_latitude , spatial latitude(grid_latitude) longitude(grid_longitude) dist(100)
acreg EWI_Index Type_2 Type_3 Type_4 Type_5  $pretreatment grid_longitude grid_latitude , spatial latitude(grid_latitude) longitude(grid_longitude) dist(100)


* Table A6.10: Model Replications without Extreme Values on DV (z-score >2)
gen ln_Agg_Acled_2 = ln_Agg_Acled_pre2013
gen ln_N_yrs_conflict_2 = ln_N_yrs_conflict_Acled_pre2013
gen ln_N_Battles_State_2 = ln_N_Battles_State_pre2013
gen ln_N_StateConflicts_2 = ln_N_StateConflicts_pre2013
gen ln_N_yrs_Stateconflict_2 = ln_N_yrs_Stateconflict_pre2013

zscore ln_Agg_Acled_2 if ln_Agg_Acled_2 > 0
replace z_ln_Agg_Acled_2 = 0 if z_ln_Agg_Acled_2 == .

zscore ln_N_yrs_conflict_2 if ln_N_yrs_conflict_2 > 0
replace z_ln_N_yrs_conflict_2 = 0 if z_ln_N_yrs_conflict_2 == .

zscore ln_N_Battles_State_2 if ln_N_Battles_State_2 > 0
replace z_ln_N_Battles_State_2 = 0 if z_ln_N_Battles_State_2 == .

zscore ln_N_StateConflicts_2 if ln_N_StateConflicts_2 > 0
replace z_ln_N_StateConflicts_2 = 0 if z_ln_N_StateConflicts_2 == .

zscore ln_N_yrs_Stateconflict_2 if ln_N_yrs_Stateconflict_2 > 0
replace z_ln_N_yrs_Stateconflict_2 = 0 if z_ln_N_yrs_Stateconflict_2 == .

reg ln_Agg_Acled_pre2013 Centralized_8hr    $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2 if z_ln_Agg_Acled_2 <2, robust 
reg ln_Agg_Acled_pre2013 Type_2 Type_3 Type_4 Type_5 $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2 if z_ln_Agg_Acled_2 <2, robust 

reg ln_N_yrs_conflict_Acled_pre2013 Centralized_8hr $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2 if z_ln_N_yrs_conflict_2 < 2, robust
reg ln_N_yrs_conflict_Acled_pre2013 Type_2 Type_3 Type_4 Type_5 $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2 if z_ln_N_yrs_conflict_2 < 2, robust

reg ln_N_Battles_State_pre2013 Centralized_8hr  $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2 if z_ln_N_Battles_State_2 < 2, robust
reg ln_N_Battles_State_pre2013 Type_2 Type_3 Type_4 Type_5 $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2 if z_ln_N_Battles_State_2 < 2, robust

reg ln_N_StateConflicts_pre2013 Centralized_8hr  $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2 if z_ln_N_StateConflicts_2 < 2, robust
reg ln_N_StateConflicts_pre2013 Type_2 Type_3 Type_4 Type_5 $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2 if z_ln_N_StateConflicts_2 < 2, robust

reg ln_N_yrs_Stateconflict_pre2013 Centralized_8hr $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2 if z_ln_N_yrs_Stateconflict_2 < 2, robust
reg ln_N_yrs_Stateconflict_pre2013 Type_2 Type_3 Type_4 Type_5  $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2 if z_ln_N_yrs_Stateconflict_2 < 2, robust

zscore nightlight_20132_mean 
zscore ln_mean2013 
zscore rwi 
zscore EWI_Index 

reg nightlight_20132_mean Centralized_8hr $pretreatment   c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2 if z_nightlight_20132_mean < 2, robust
reg nightlight_20132_mean Type_2 Type_3 Type_4 Type_5 $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2 if z_nightlight_20132_mean < 2, robust

reg ln_mean2013 Centralized_8hr $pretreatment c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 if z_ln_mean2013 < 2, robust
reg ln_mean2013 Type_2 Type_3 Type_4 Type_5 $pretreatment c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 if z_ln_mean2013 < 2, robust

reg rwi Centralized_8hr $pretreatment c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 if z_rwi < 2, robust
reg rwi Type_2 Type_3 Type_4 Type_5 $pretreatment c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 if z_rwi < 2, robust

reg EWI_Index Centralized_8hr $pretreatment c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 if z_EWI_Index < 2, robust
reg EWI_Index Type_2 Type_3 Type_4 Type_5 $pretreatment c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 if z_EWI_Index < 2, robust
}


*** SECTION 6.5: Model Replications: States Present on Eve of Colonization
{
* Table A6.11: Model Replications: Base Statehood - Polities Present in late 1800s only
reg ln_Agg_Acled_pre2013 Centralized_8hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store ln_agAcled
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_conflict_Acled_pre2013 Centralized_8hr  $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_YrsAcled
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_Battles_State_pre2013 Centralized_8hr  $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNBattle
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_StateConflicts_pre2013 Centralized_8hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNConflict
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_Stateconflict_pre2013 Centralized_8hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnYrsConflict
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	
reg nightlight_20132_mean Centralized_8hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store Mean2013
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_mean2013 Centralized_8hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_Mean2013
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg rwi Centralized_8hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store rwi
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg EWI_Index Centralized_8hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ewi
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"

esttab ln_agAcled ln_YrsAcled lnNBattle lnNConflict lnYrsConflict Mean2013 ln_Mean2013 rwi ewi using "Data/Table Output/Base_1880.tex", replace ///
	scalars(r2 "Geo Coords" "CN Pretreatment Vars") modelwidth(2) se b(3) star (* 0.1 ** 0.05 *** 0.001) drop(grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Model Replications: Base Centralization - Polities Present in late 1800s only"\label{Base_1880}) nonumbers compress  ///
	mtitles("ln Acled Battles" "ln ACLED Yrs Conflict" "ln UCDP Battles" "ln # UCDP Conflicts" "ln UCDP Yrs Conflict" "Mean Nightlights" "ln Mean Nightlights" "RWI" "EWD")

* Table A6.12: Model Replications: State Type - Polities Present in late 1800s only
reg ln_Agg_Acled_pre2013 i.Polity_Type_1880_8hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store ln_agAcled
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_conflict_Acled_pre2013 i.Polity_Type_1880_8hr  $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_YrsAcled
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_Battles_State_pre2013 i.Polity_Type_1880_8hr   $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNBattle
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_StateConflicts_pre2013 i.Polity_Type_1880_8hr  $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNConflict
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_Stateconflict_pre2013 i.Polity_Type_1880_8hr  $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnYrsConflict
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	
reg nightlight_20132_mean i.Polity_Type_1880_8hr  $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store Mean2013
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_mean2013 i.Polity_Type_1880_8hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_Mean2013
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg rwi i.Polity_Type_1880_8hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store rwi
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg EWI_Index i.Polity_Type_1880_8hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ewi
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
		
esttab ln_agAcled ln_YrsAcled lnNBattle lnNConflict lnYrsConflict Mean2013 ln_Mean2013 rwi ewi using "Data/Table Output/Type_1880.tex", replace ///
	scalars(r2 "Geo Coords" "CN Pretreatment Vars") modelwidth(2) se b(3) star (* 0.1 ** 0.05 *** 0.001) drop(grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Model Replications: Type Centralization - Polities Present in late 1800s only"\label{Type_1880}) nonumbers compress  ///
	mtitles("ln Acled Battles" "ln ACLED Yrs Conflict" "ln UCDP Battles" "ln # UCDP Conflicts" "ln UCDP Yrs Conflict" "Mean Nightlights" "ln Mean Nightlights" "RWI" "EWD")
} 

 
*** SECTION 6.6: Model Replications: 6 and 10 hour walk times
{
* Table A6.13: Model Replications: Base Statehood - 6hr Walk Time
reg ln_Agg_Acled_pre2013 Centralized_6hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_agAcled_6h
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_conflict_Acled_pre2013 Centralized_6hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_YrsAcled_6h
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_Battles_State_pre2013 Centralized_6hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNBattle_6h
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_StateConflicts_pre2013 Centralized_6hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNConflict_6h
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_Stateconflict_pre2013 Centralized_6hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnYrsConflict_6h
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"

reg nightlight_20132_mean Centralized_6hr $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store Mean2013_6h
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_mean2013 Centralized_6hr $pretreatment c.grid_longitude#c.grid_latitude, cluster(grid0_5_id)
	est store ln_Mean2013_6h
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg rwi Centralized_6hr $pretreatment c.grid_longitude#c.grid_latitude, cluster(grid0_5_id)
	est store rwi_6h
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg EWI_Index Centralized_6hr $pretreatment c.grid_longitude#c.grid_latitude, cluster(grid0_5_id)
	est store ewi_6h
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	
esttab ln_agAcled_6h ln_YrsAcled_6h lnNBattle_6h lnNConflict_6h lnYrsConflict_6h Mean2013_6h ln_Mean2013_6h rwi_6h ewi_6h using "Data/Table Output/Base_6h.tex", replace ///
	scalars(r2 "Geo Coords" "CN Pretreatment Vars") modelwidth(2) se b(3) star (* 0.1 ** 0.05 *** 0.001) drop(grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Model Replications: Base Centralization - 6hr Walk Time"\label{Base_6hr}) nonumbers compress  ///
	mtitles("ln Acled Battles" "ln ACLED Yrs Conflict" "ln UCDP Battles" "ln # UCDP Conflicts" "ln UCDP Yrs Conflict" "Mean Nightlights" "ln Mean Nightlights" "RWI" "EWD")

* Table A6.14: Model Replications: State Type - 6hr Walk Time		
reg ln_Agg_Acled_pre2013 i.Polity_Type_6hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_agAcled_6h
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_conflict_Acled_pre2013 i.Polity_Type_6hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_YrsAcled_6h
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_Battles_State_pre2013 i.Polity_Type_6hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNBattle_6h
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_StateConflicts_pre2013 i.Polity_Type_6hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNConflict_6h
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_Stateconflict_pre2013 i.Polity_Type_6hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnYrsConflict_6h
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	
reg nightlight_20132_mean i.Polity_Type_6hr   $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store Mean2013_6h
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_mean2013  i.Polity_Type_6hr   $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store ln_Mean2013_6h
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg rwi i.Polity_Type_6hr  $pretreatment  c.grid_longitude#c.grid_latitude, cluster(grid0_5_id)
	est store rwi_6h
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg EWI_Index i.Polity_Type_6hr $pretreatment c.grid_longitude#c.grid_latitude, cluster(grid0_5_id)
	est store ewi_6h
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"

				
esttab ln_agAcled_6h ln_YrsAcled_6h lnNBattle_6h lnNConflict_6h lnYrsConflict_6h Mean2013_6h ln_Mean2013_6h rwi_6h ewi_6h using "Data/Table Output/Type_6hr.tex", replace ///
	scalars(r2 "Geo Coords" "CN Pretreatment Vars") modelwidth(2) se b(3) star (* 0.1 ** 0.05 *** 0.001) drop(grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Model Replications: Type Centralization - 6hr Walk Time"\label{Type_6hr}) nonumbers compress  ///
	mtitles("ln Acled Battles" "ln ACLED Yrs Conflict" "ln UCDP Battles" "ln # UCDP Conflicts" "ln UCDP Yrs Conflict" "Mean Nightlights" "ln Mean Nightlights" "RWI" "EWD")
	
	
* Table A6.15: Model Replications: Base Statehood - 10hr Walk Time
reg ln_Agg_Acled_pre2013 Centralized_10hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_agAcled_10hr
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_conflict_Acled_pre2013 Centralized_10hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_YrsAcled_10hr
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_Battles_State_pre2013 Centralized_10hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNBattle_10hr
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_StateConflicts_pre2013 Centralized_10hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNConflict_10hr
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_Stateconflict_pre2013 Centralized_10hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnYrsConflict_10hr
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	
reg nightlight_20132_mean Centralized_10hr $pretreatment c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store Mean2013_10hr
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_mean2013 Centralized_10hr $pretreatment c.grid_longitude#c.grid_latitude, cluster(grid0_5_id)
	est store ln_Mean2013_10hr
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg rwi Centralized_10hr $pretreatment c.grid_longitude#c.grid_latitude, cluster(grid0_5_id)
	est store rwi_10hr
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg EWI_Index Centralized_10hr $pretreatment c.grid_longitude#c.grid_latitude, cluster(grid0_5_id)
	est store ewi_10hr
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"

			
esttab ln_agAcled_10hr ln_YrsAcled_10hr lnNBattle_10hr lnNConflict_10hr lnYrsConflict_10hr Mean2013_10hr ln_Mean2013_10hr rwi_10hr ewi_10hr using "Data/Table Output/Base_10hr.tex", replace ///
	scalars(r2 "Geo Coords" "CN Pretreatment Vars") modelwidth(2) se b(3) star (* 0.1 ** 0.05 *** 0.001) drop(grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Model Replications: Base Centralization - 10hr Walk Time"\label{Base_10hr}) nonumbers compress  ///
	mtitles("ln Acled Battles" "ln ACLED Yrs Conflict" "ln UCDP Battles" "ln # UCDP Conflicts" "ln UCDP Yrs Conflict" "Mean Nightlights" "ln Mean Nightlights" "RWI" "EWD")

* Table A6.16: Model Replications: State Type - 10hr Walk Time		
reg ln_Agg_Acled_pre2013 i.Polity_Type_10hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_agAcled_10hr
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_conflict_Acled_pre2013 i.Polity_Type_10hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_YrsAcled_10hr
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_Battles_State_pre2013 i.Polity_Type_10hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNBattle_10hr
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_StateConflicts_pre2013 i.Polity_Type_10hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNConflict_10hr
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_Stateconflict_pre2013 i.Polity_Type_10hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnYrsConflict_10hr
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	
reg nightlight_20132_mean i.Polity_Type_10hr   $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store Mean2013_10hr
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_mean2013  i.Polity_Type_10hr   $pretreatment  c.grid_longitude##c.grid_latitude grid_longitude2 grid_latitude2, cluster(grid0_5_id)
	est store ln_Mean2013_10hr
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg rwi i.Polity_Type_10hr  $pretreatment  c.grid_longitude#c.grid_latitude, cluster(grid0_5_id)
	est store rwi_10hr
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg EWI_Index i.Polity_Type_10hr $pretreatment c.grid_longitude#c.grid_latitude, cluster(grid0_5_id)
	est store ewi_10hr
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
				
esttab ln_agAcled_10hr ln_YrsAcled_10hr lnNBattle_10hr lnNConflict_10hr lnYrsConflict_10hr Mean2013_10hr ln_Mean2013_10hr rwi_10hr ewi_10hr using "Data/Table Output/Type_10hr.tex", replace ///
	scalars(r2 "Geo Coords" "CN Pretreatment Vars") modelwidth(2) se b(3) star (* 0.1 ** 0.05 *** 0.001) drop(grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Model Replications: Type Centralization - 10hr Walk Time"\label{Type_10hr}) nonumbers compress  ///
	mtitles("ln Acled Battles" "ln ACLED Yrs Conflict" "ln UCDP Battles" "ln # UCDP Conflicts" "ln UCDP Yrs Conflict" "Mean Nightlights" "ln Mean Nightlights" "RWI" "EWD")
 }


*** Table A6.17: Model Replications: State Type - Composite States
{
reg ln_Agg_Acled_pre2013 i.Polity_Type_Comp_8hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store ln_agAcled
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_conflict_Acled_pre2013 i.Polity_Type_Comp_8hr  $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_YrsAcled
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_Battles_State_pre2013 i.Polity_Type_Comp_8hr   $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNBattle
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_StateConflicts_pre2013 i.Polity_Type_Comp_8hr  $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNConflict
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_Stateconflict_pre2013 i.Polity_Type_Comp_8hr  $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnYrsConflict
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	
reg nightlight_20132_mean i.Polity_Type_Comp_8hr  $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store Mean2013
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_mean2013 i.Polity_Type_Comp_8hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_Mean2013
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg rwi i.Polity_Type_Comp_8hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store rwi
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg EWI_Index i.Polity_Type_Comp_8hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ewi
	estadd local  LL  "Yes"	
	estadd local  CN  "Yes"
				
esttab ln_agAcled ln_YrsAcled lnNBattle lnNConflict lnYrsConflict Mean2013 ln_Mean2013 rwi ewi using "Data/Table Output/Type_Comp.tex", replace ///
	scalars(r2 "Geo Coords" "CN Pretreatment Vars") modelwidth(2) se b(3) star (* 0.1 ** 0.05 *** 0.001) drop(grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Model Replications: Type Centralization - Composite States"\label{Type_Comp}) nonumbers compress  ///
	mtitles("ln Acled Battles" "ln ACLED Yrs Conflict" "ln UCDP Battles" "ln # UCDP Conflicts" "ln UCDP Yrs Conflict" "Mean Nightlights" "ln Mean Nightlights" "RWI" "EWD")
} 


*** SECTION 6.8: Model Replications: Maximum and Minimum Uncertainty Estimates
{
* Table A6.18: Model Replications: Base Statehood - Maximum Uncertainty Estimate
reg ln_Agg_Acled_pre2013 Centralized_uncertaintyMAX     $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store ln_agAcled
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_conflict_Acled_pre2013 Centralized_uncertaintyMAX  $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_YrsAcled
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_Battles_State_pre2013 Centralized_uncertaintyMAX   $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNBattle
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_StateConflicts_pre2013 Centralized_uncertaintyMAX   $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNConflict
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_Stateconflict_pre2013 Centralized_uncertaintyMAX $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnYrsConflict
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"

reg nightlight_20132_mean Centralized_uncertaintyMAX $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store Mean2013
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_mean2013 Centralized_uncertaintyMAX $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_Mean2013
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg rwi Centralized_uncertaintyMAX $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store rwi
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg EWI_Index Centralized_uncertaintyMAX $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ewi
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
		
esttab ln_agAcled ln_YrsAcled lnNBattle lnNConflict lnYrsConflict Mean2013 ln_Mean2013 rwi ewi using "Data/Table Output/Base_max.tex", replace ///
	scalars(r2 "Geo Coords" "CN Pretreatment Vars") modelwidth(2) se b(3) star (* 0.1 ** 0.05 *** 0.001) drop(grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Model Replications: Base Centralization - Maximum Uncertainty Estimate"\label{Base_max}) nonumbers compress  ///
	mtitles("ln Acled Battles" "ln ACLED Yrs Conflict" "ln UCDP Battles" "ln # UCDP Conflicts" "ln UCDP Yrs Conflict" "Mean Nightlights" "ln Mean Nightlights" "RWI" "EWD")
	
* Table A6.19: Model Replications: State Type - Maximum Uncertainty Estimate
reg ln_Agg_Acled_pre2013 Type_Max_2 Type_Max_3 Type_Max_4 Type_Max_5 $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store ln_agAcled
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_conflict_Acled_pre2013 Type_Max_2 Type_Max_3 Type_Max_4 Type_Max_5 $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_YrsAcled
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_Battles_State_pre2013 Type_Max_2 Type_Max_3 Type_Max_4 Type_Max_5 $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNBattle
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_StateConflicts_pre2013 Type_Max_2 Type_Max_3 Type_Max_4 Type_Max_5 $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNConflict
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_Stateconflict_pre2013 Type_Max_2 Type_Max_3 Type_Max_4 Type_Max_5 $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnYrsConflict
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"

reg nightlight_20132_mean Type_Max_2 Type_Max_3 Type_Max_4 Type_Max_5 $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store Mean2013
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_mean2013  Type_Max_2 Type_Max_3 Type_Max_4 Type_Max_5 $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_Mean2013
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg rwi  Type_Max_2 Type_Max_3 Type_Max_4 Type_Max_5 $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store rwi
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg EWI_Index  Type_Max_2 Type_Max_3 Type_Max_4 Type_Max_5 $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ewi
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
		
esttab ln_agAcled ln_YrsAcled lnNBattle lnNConflict lnYrsConflict Mean2013 ln_Mean2013 rwi ewi using "Data/Table Output/Type_max.tex", replace ///
	scalars(r2 "Geo Coords" "CN Pretreatment Vars") modelwidth(2) se b(3) star (* 0.1 ** 0.05 *** 0.001) drop(grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Model Replications: Type Centralization - Maximum Uncertainty Estimate"\label{Type_max}) nonumbers compress  ///
	mtitles("ln Acled Battles" "ln ACLED Yrs Conflict" "ln UCDP Battles" "ln # UCDP Conflicts" "ln UCDP Yrs Conflict" "Mean Nightlights" "ln Mean Nightlights" "RWI" "EWD")


* Table A6.20: Model Replications: Base Statehood - Minimum Uncertainty Estimate
reg ln_Agg_Acled_pre2013 Centralized_uncertaintyMIN     $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store ln_agAcled
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_conflict_Acled_pre2013 Centralized_uncertaintyMIN  $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_YrsAcled
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_Battles_State_pre2013 Centralized_uncertaintyMIN   $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNBattle
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_StateConflicts_pre2013 Centralized_uncertaintyMIN   $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNConflict
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_Stateconflict_pre2013 Centralized_uncertaintyMIN $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnYrsConflict
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"

reg nightlight_20132_mean Centralized_uncertaintyMIN $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store Mean2013
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_mean2013 Centralized_uncertaintyMIN $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_Mean2013
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg rwi Centralized_uncertaintyMIN $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store rwi
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg EWI_Index Centralized_uncertaintyMIN $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ewi
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	
esttab ln_agAcled ln_YrsAcled lnNBattle lnNConflict lnYrsConflict Mean2013 ln_Mean2013 rwi ewi using "Data/Table Output/Base_min.tex", replace ///
	scalars(r2 "Geo Coords" "CN Pretreatment Vars") modelwidth(2) se b(3) star (* 0.1 ** 0.05 *** 0.001) drop(grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Model Replications: Base Centralization - Minimum Uncertainty Estimate"\label{Base_min}) nonumbers compress  ///
	mtitles("ln Acled Battles" "ln ACLED Yrs Conflict" "ln UCDP Battles" "ln # UCDP Conflicts" "ln UCDP Yrs Conflict" "Mean Nightlights" "ln Mean Nightlights" "RWI" "EWD")


* Table A6.21: Model Replications: State Type - Minimum Uncertainty Estimate
reg ln_Agg_Acled_pre2013 Type_Min_2 Type_Min_3 Type_Min_4 Type_Min_5 $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store ln_agAcled
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_conflict_Acled_pre2013 Type_Min_2 Type_Min_3 Type_Min_4 Type_Min_5 $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_YrsAcled
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_Battles_State_pre2013 Type_Min_2 Type_Min_3 Type_Min_4 Type_Min_5 $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNBattle
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_StateConflicts_pre2013 Type_Min_2 Type_Min_3 Type_Min_4 Type_Min_5 $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNConflict
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_Stateconflict_pre2013 Type_Min_2 Type_Min_3 Type_Min_4 Type_Min_5 $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnYrsConflict
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"


reg nightlight_20132_mean Type_Min_2 Type_Min_3 Type_Min_4 Type_Min_5 $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store Mean2013
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_mean2013  Type_Min_2 Type_Min_3 Type_Min_4 Type_Min_5 $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_Mean2013
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg rwi  Type_Min_2 Type_Min_3 Type_Min_4 Type_Min_5 $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store rwi
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg EWI_Index  Type_Min_2 Type_Min_3 Type_Min_4 Type_Min_5 $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ewi
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	
esttab ln_agAcled ln_YrsAcled lnNBattle lnNConflict lnYrsConflict Mean2013 ln_Mean2013 rwi ewi using "Data/Table Output/Type_min.tex", replace ///
	scalars(r2 "Geo Coords" "CN Pretreatment Vars") modelwidth(2) se b(3) star (* 0.1 ** 0.05 *** 0.001) drop(grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Model Replications: Type Centralization - Minimum Uncertainty Estimate"\label{Type_min}) nonumbers compress  ///
	mtitles("ln Acled Battles" "ln ACLED Yrs Conflict" "ln UCDP Battles" "ln # UCDP Conflicts" "ln UCDP Yrs Conflict" "Mean Nightlights" "ln Mean Nightlights" "RWI" "EWD")
}

 
*** SECTION 6.9: Model Replications: Assessing the Impact of Contested Territory
{
* Table A6.22: Con#ict Models: Controlling for Contested Territory
reg ln_Agg_Acled_pre2013 Centralized_8hr  $pretreatment  Contested_1880_8hr c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_agAcled1
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_Agg_Acled_pre2013 i.Polity_Type_8hr  $pretreatment  Contested_1880_8hr c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id) 
	est store ln_agAcled2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"

reg ln_N_yrs_conflict_Acled_pre2013 Centralized_8hr  $pretreatment   Contested_1880_8hr c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_YrsAcled1
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_conflict_Acled_pre2013 i.Polity_Type_8hr  $pretreatment  Contested_1880_8hr c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_YrsAcled2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"

reg ln_N_Battles_State_pre2013 Centralized_8hr  $pretreatment   Contested_1880_8hr c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNBattle1
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_Battles_State_pre2013 i.Polity_Type_8hr $pretreatment  Contested_1880_8hr c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNBattle2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"

reg ln_N_StateConflicts_pre2013 Centralized_8hr  $pretreatment   Contested_1880_8hr c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNConflict1
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_StateConflicts_pre2013 i.Polity_Type_8hr   $pretreatment  Contested_1880_8hr c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNConflict2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"

reg ln_N_yrs_Stateconflict_pre2013 Centralized_8hr  $pretreatment   Contested_1880_8hr c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnYrsConflict1
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_N_yrs_Stateconflict_pre2013 i.Polity_Type_8hr  $pretreatment  Contested_1880_8hr c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2 ,   cluster(grid0_5_id)
	est store lnYrsConflict2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	
esttab ln_agAcled1 ln_agAcled2 ln_YrsAcled1 ln_YrsAcled2 lnNBattle1 lnNBattle2 lnNConflict1 lnNConflict2 lnYrsConflict1 lnYrsConflict2 using "Data/Table Output/BaseResults_Conflict_Contested.tex", replace ///
	scalars(r2 "Geo Coords" "CN Pretreatment Vars") modelwidth(2) se b(3) star (* 0.1 ** 0.05 *** 0.001) drop(grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Model Results"\label{Base_Conflict_Contested}) nonumbers compress  ///
	mtitles("ln Acled Battles" "ln ACLED Yrs Conflict" "ln UCDP Battles" "ln # UCDP Conflicts" "ln UCDP Yrs Conflict")

	
* Table A6.23: Development Models: Controlling for Contested Territory
reg nightlight_20132_mean Centralized_8hr  $pretreatment   Contested_1880_8hr c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store Mean2013_1
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg nightlight_20132_mean i.Polity_Type_8hr  $pretreatment  Contested_1880_8hr c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store Mean2013_2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"

reg ln_mean2013 Centralized_8hr  $pretreatment   Contested_1880_8hr c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_Mean2013_1
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg ln_mean2013 i.Polity_Type_8hr  $pretreatment  Contested_1880_8hr c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ln_Mean2013_2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"

reg rwi Centralized_8hr  $pretreatment   Contested_1880_8hr c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store rwi1
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg rwi i.Polity_Type_8hr  $pretreatment  Contested_1880_8hr c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store rwi2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	
reg EWI_Index Centralized_8hr  $pretreatment   Contested_1880_8hr c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ewi1
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
reg EWI_Index i.Polity_Type_8hr  $pretreatment  Contested_1880_8hr c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store ewi2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"


esttab Mean2013_1 Mean2013_2 ln_Mean2013_1 ln_Mean2013_2 rwi1 rwi2 ewi1 ewi2 using "Data/Table Output/TypeResults_Dev_Contested.tex", replace ///
	scalars(r2 "Geo Coords" "CN Pretreatment Vars") modelwidth(2) se b(3) star (* 0.1 ** 0.05 *** 0.001) drop(grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Model Results"\label{Type_Dev_Contested}) nonumbers compress  ///
	mtitles("Mean Nightlights" "ln Mean Nightlights" "RWI" "EWD")
}


*** SECTION 7: Assessing the Counterfactual
{
* Table A7.1: Conflict Outcomes - State Type with Full Sample
use "Data/APSR_Data_Final.dta", clear

reg ln_Agg_Acled_pre2013 Centralized_8hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2 ,   cluster(grid0_5_id)
	est store ln_agAcled1
	estadd local  LL  "Yes"
reg ln_Agg_Acled_pre2013 i.Polity_Type_8hr  $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2 ,   cluster(grid0_5_id) 
	est store ln_agAcled2
	estadd local  LL  "Yes"
reg ln_N_yrs_conflict_Acled_pre2013 Centralized_8hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2 ,   cluster(grid0_5_id)
	est store ln_YrsAcled1
	estadd local  LL  "Yes"
reg ln_N_yrs_conflict_Acled_pre2013 i.Polity_Type_8hr  $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2 ,   cluster(grid0_5_id)
	est store ln_YrsAcled2
	estadd local  LL  "Yes"
reg ln_N_Battles_State_pre2013 Centralized_8hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2 ,   cluster(grid0_5_id)
	est store lnNBattle1
	estadd local  LL  "Yes"
reg ln_N_Battles_State_pre2013 i.Polity_Type_8hr   $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2 ,   cluster(grid0_5_id)
	est store lnNBattle2
	estadd local  LL  "Yes"
reg ln_N_StateConflicts_pre2013 Centralized_8hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2 ,   cluster(grid0_5_id)
	est store lnNConflict1
	estadd local  LL  "Yes"
reg ln_N_StateConflicts_pre2013 i.Polity_Type_8hr $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid0_5_id)
	est store lnNConflict2
	estadd local  LL  "Yes"
reg ln_N_yrs_Stateconflict_pre2013 Centralized_8hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2 ,   cluster(grid0_5_id)
	est store lnYrsConflict1
	estadd local  LL  "Yes"
reg ln_N_yrs_Stateconflict_pre2013 i.Polity_Type_8hr  $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2  ,   cluster(grid0_5_id)
	est store lnYrsConflict2
	estadd local  LL  "Yes"
	
esttab ln_agAcled1 ln_agAcled2 ln_YrsAcled1 ln_YrsAcled2 lnNBattle1 lnNBattle2 lnNConflict1 lnNConflict2 lnYrsConflict1 lnYrsConflict2 using "Data/Table Output/BaseResults_Conflict_Counterfactual_Full.tex", replace ///
	scalars(r2 "Geo Coords" "CN Pretreatment Vars") modelwidth(2) se b(3) star (* 0.1 ** 0.05 *** 0.001) drop(grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Model Results"\label{Conflict_Counterfactual}) nonumbers compress  ///
	mtitles("ln Acled Battles" "ln ACLED Yrs Conflict" "ln UCDP Battles" "ln # UCDP Conflicts" "ln UCDP Yrs Conflict")

* Table A7.2: Development Outcomes - State Type with Full Sample
reg nightlight_20132_mean Centralized_8hr $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2 ,   cluster(grid0_5_id)
	est store Mean2013_1
	estadd local  LL  "Yes"
reg nightlight_20132_mean i.Polity_Type_8hr  $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2 ,   cluster(grid0_5_id)
	est store Mean2013_2
	estadd local  LL  "Yes"
reg ln_mean2013 Centralized_8hr $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2 ,   cluster(grid0_5_id)
	est store ln_Mean2013_1
	estadd local  LL  "Yes"
reg ln_mean2013 i.Polity_Type_8hr  $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2 ,   cluster(grid0_5_id)
	est store ln_Mean2013_2
	estadd local  LL  "Yes"
reg rwi Centralized_8hr $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2 ,   cluster(grid0_5_id)
	est store rwi1
	estadd local  LL  "Yes"
reg rwi i.Polity_Type_8hr  $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2 ,   cluster(grid0_5_id)
	est store rwi2
	estadd local  LL  "Yes"	
reg EWI_Index Centralized_8hr $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2 ,   cluster(grid0_5_id)
	est store ewi1
	estadd local  LL  "Yes"
reg EWI_Index i.Polity_Type_8hr  $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2 ,   cluster(grid0_5_id)
	est store ewi2
	estadd local  LL  "Yes"

esttab Mean2013_1 Mean2013_2 ln_Mean2013_1 ln_Mean2013_2 rwi1 rwi2 ewi1 ewi2 using "Data/Table Output/TypeResults_Dev_Counterfactual_Full.tex", replace ///
	scalars(r2 "Geo Coords" "CN Pretreatment Vars") modelwidth(2) se b(3) star (* 0.1 ** 0.05 *** 0.001) drop(grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Model Results"\label{Type_Dev_Counteractual}) nonumbers compress  ///
	mtitles("Mean Nightlights" "ln Mean Nightlights" "RWI" "EWD")

* Figure A7.1: Assessing the counterfactual: What geographies supported statehood?
kdensity malaria_2000 if Centralized_8hr == 0, xtitle(Malaria Prevalence) title("") note("")
graph save "malaria_0", replace
kdensity malaria_2000 if Centralized_8hr == 1, xtitle(Malaria Prevalence) title("") note("")
graph save "malaria_1", replace

kdensity precipitation if Centralized_8hr == 0, xtitle(Precipitation) title("") note("")
graph save "prec_0", replace
kdensity precipitation if Centralized_8hr == 1, xtitle(Precipitation) title("") note("")
graph save "prec_1", replace

kdensity mt_binary_mean if Centralized_8hr == 0, xtitle(Mountain) title("") note("")
graph save "mt_0", replace
kdensity mt_binary_mean if Centralized_8hr == 1, xtitle(Mountain) title("") note("")
graph save "mt_1", replace

kdensity grid_perc_h20 if Centralized_8hr == 0, xtitle(% Water) title("") note("")
graph save "water_0", replace
kdensity grid_perc_h20 if Centralized_8hr == 1, xtitle(% Water) title("") note("")
graph save "water_1", replace

kdensity elevation if Centralized_8hr == 0, xtitle(Elevation) title("") note("")
graph save "elev_0", replace
kdensity elevation if Centralized_8hr == 1, xtitle(Elevation) title("") note("")
graph save "elev_1", replace

kdensity Rugged_RuggednessFinal if Centralized_8hr == 0, xtitle(Terrain Ruggedness) title("") note("")
graph save "terrain_0", replace
kdensity Rugged_RuggednessFinal if Centralized_8hr == 1, xtitle(Terrain Ruggedness) title("") note("")
graph save "terrain_1", replace

kdensity grid_longitude if Centralized_8hr == 0, xtitle(Longitude) title("") note("")
graph save "long_0", replace
kdensity grid_longitude if Centralized_8hr == 1, xtitle(Longitude) title("") note("")
graph save "long_1", replace

kdensity grid_latitude if Centralized_8hr == 0, xtitle(Latitude) title("") note("")
graph save "lat_0", replace
kdensity grid_latitude if Centralized_8hr == 1, xtitle(Latitude) title("") note("")
graph save "lat_1", replace

graph combine "malaria_0" "prec_0" "mt_0" "water_0" "elev_0" "terrain_0" "long_0" "lat_0", title("a. Stateless") name(grcol1,replace) col(1)
graph combine "malaria_1" "prec_1" "mt_1" "water_1" "elev_1" "terrain_1" "long_1" "lat_1", title("b. States") name(grcol2,replace) col(1)
graph combine grcol1 grcol2, col(2) xsize(6) ysize(8) 


* Table A7.3: Conflict Models: Assessing the Counterfactual - Dropping Uninhabited Cells
reg ln_Agg_Acled_pre2013 Centralized_8hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2 if popdensity_0ad > 0,   cluster(grid0_5_id)
	est store ln_agAcled1
	estadd local  LL  "Yes"
reg ln_Agg_Acled_pre2013 i.Polity_Type_8hr  $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2 if popdensity_0ad > 0,   cluster(grid0_5_id) 
	est store ln_agAcled2
	estadd local  LL  "Yes"
reg ln_N_yrs_conflict_Acled_pre2013 Centralized_8hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2 if popdensity_0ad > 0,   cluster(grid0_5_id)
	est store ln_YrsAcled1
	estadd local  LL  "Yes"
reg ln_N_yrs_conflict_Acled_pre2013 i.Polity_Type_8hr  $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2 if popdensity_0ad > 0,   cluster(grid0_5_id)
	est store ln_YrsAcled2
	estadd local  LL  "Yes"
reg ln_N_Battles_State_pre2013 Centralized_8hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2 if popdensity_0ad > 0,   cluster(grid0_5_id)
	est store lnNBattle1
	estadd local  LL  "Yes"
reg ln_N_Battles_State_pre2013 i.Polity_Type_8hr   $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2 if popdensity_0ad > 0,   cluster(grid0_5_id)
	est store lnNBattle2
	estadd local  LL  "Yes"
reg ln_N_StateConflicts_pre2013 Centralized_8hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2 if popdensity_0ad > 0,   cluster(grid0_5_id)
	est store lnNConflict1
	estadd local  LL  "Yes"
reg ln_N_StateConflicts_pre2013 i.Polity_Type_8hr $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2 if popdensity_0ad > 0,   cluster(grid0_5_id)
	est store lnNConflict2
	estadd local  LL  "Yes"
reg ln_N_yrs_Stateconflict_pre2013 Centralized_8hr $pretreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2 if popdensity_0ad > 0,   cluster(grid0_5_id)
	est store lnYrsConflict1
	estadd local  LL  "Yes"
reg ln_N_yrs_Stateconflict_pre2013 i.Polity_Type_8hr  $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2  if popdensity_0ad > 0,   cluster(grid0_5_id)
	est store lnYrsConflict2
	estadd local  LL  "Yes"
	
esttab ln_agAcled1 ln_agAcled2 ln_YrsAcled1 ln_YrsAcled2 lnNBattle1 lnNBattle2 lnNConflict1 lnNConflict2 lnYrsConflict1 lnYrsConflict2 using "Data/Table Output/BaseResults_Conflict_Counterfactual_nopop.tex", replace ///
	scalars(r2 "Geo Coords" "CN Pretreatment Vars") modelwidth(2) se b(3) star (* 0.1 ** 0.05 *** 0.001) drop(grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Model Results"\label{Conflict_Counterfactual_nopop}) nonumbers compress  ///
	mtitles("ln Acled Battles" "ln ACLED Yrs Conflict" "ln UCDP Battles" "ln # UCDP Conflicts" "ln UCDP Yrs Conflict")

	
* Table A7.4: Development Models: Assessing the Counterfactual - Dropping Uninhabited Cells	
reg nightlight_20132_mean Centralized_8hr $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2 if popdensity_0ad > 0,   cluster(grid0_5_id)
	est store Mean2013_1
	estadd local  LL  "Yes"
reg nightlight_20132_mean i.Polity_Type_8hr  $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2 if popdensity_0ad > 0,   cluster(grid0_5_id)
	est store Mean2013_2
	estadd local  LL  "Yes"
reg ln_mean2013 Centralized_8hr $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2 if popdensity_0ad > 0,   cluster(grid0_5_id)
	est store ln_Mean2013_1
	estadd local  LL  "Yes"
reg ln_mean2013 i.Polity_Type_8hr  $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2 if popdensity_0ad > 0,   cluster(grid0_5_id)
	est store ln_Mean2013_2
	estadd local  LL  "Yes"
reg rwi Centralized_8hr $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2 if popdensity_0ad > 0,   cluster(grid0_5_id)
	est store rwi1
	estadd local  LL  "Yes"
reg rwi i.Polity_Type_8hr  $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2 if popdensity_0ad > 0,   cluster(grid0_5_id)
	est store rwi2
	estadd local  LL  "Yes"	
reg EWI_Index Centralized_8hr $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2 if popdensity_0ad > 0,   cluster(grid0_5_id)
	est store ewi1
	estadd local  LL  "Yes"
reg EWI_Index i.Polity_Type_8hr  $pretreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2 if popdensity_0ad > 0,   cluster(grid0_5_id)
	est store ewi2
	estadd local  LL  "Yes"

esttab Mean2013_1 Mean2013_2 ln_Mean2013_1 ln_Mean2013_2 rwi1 rwi2 ewi1 ewi2 using "Data/Table Output/TypeResults_Dev_Counterfactual_nopop.tex", replace ///
	scalars(r2 "Geo Coords" "CN Pretreatment Vars") modelwidth(2) se b(3) star (* 0.1 ** 0.05 *** 0.001) drop(grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Model Results"\label{Type_Dev_Counteractual_nopop}) nonumbers compress  ///
	mtitles("Mean Nightlights" "ln Mean Nightlights" "RWI" "EWD")
}


*** SECTION 8: Adjusting the Grid Sampling Size
{ 
* Table A8.1: Main Model Replications: Base Statehood - 0.25 degree grid cells
use "Data/Appendix/Larger Grids/FINAL_CLIPPED_25degrees.dta", clear

drop if Counterfactual_25 == 0

reg ln_Agg_Acled_pre2013 Centralized_8hr     $pretreatment $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid1dg_id) 
	est store ln_agAcled
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"	
reg ln_N_yrs_conflict_Acled_pre2013 Centralized_8hr  $pretreatment $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid1dg_id)
	est store ln_YrsAcled
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"	

reg ln_N_Battles_State_pre2013 Centralized_8hr   $pretreatment $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid1dg_id)
	est store lnNBattle
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"	
reg ln_N_StateConflicts_pre2013 Centralized_8hr   $pretreatment $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid1dg_id)
	est store lnNConflict
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"	
reg ln_N_yrs_Stateconflict_pre2013 Centralized_8hr $pretreatment $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid1dg_id)
	est store lnYrsConflict
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"	

reg nightlight_20132_mean Centralized_8hr $pretreatment $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid1dg_id)
	est store Mean2013
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"	
reg ln__mean2013 Centralized_8hr $pretreatment $posttreatment c.grid_longitude#c.grid_latitude,   cluster(grid1dg_id)
	est store ln_Mean2013
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"	
reg rwi Centralized_8hr $pretreatment $posttreatment_post2011  c.grid_longitude#c.grid_latitude,   cluster(grid1dg_id)
	est store rwi
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"	
reg EWI_Index Centralized_8hr $pretreatment $posttreatment_post2011 c.grid_longitude#c.grid_latitude,   cluster(grid1dg_id)
	est store ewi
	estadd local  LL  "Yes"	
	estadd local  CN  "Yes"	

esttab ln_agAcled  ln_YrsAcled  lnNBattle  lnNConflict  lnYrsConflict Mean2013  ln_Mean2013  rwi ewi using "Data/Table Output/BaseResults_25grid.tex", replace ///
	scalars(r2 LL "Geo Coords" "CN Pretreatment Vars") modelwidth(2) se b(3) star (* 0.1 ** 0.05 *** 0.001) drop(grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Main Model Replications: Base Centralization - 25 degree grid cells"\label{Base_25deg}) nonumbers compress  ///
	mtitles("ln Acled Battles" "ln ACLED Yrs Conflict" "ln UCDP Battles" "ln # UCDP Conflicts" "ln UCDP Yrs Conflict" "Mean Nightlights" "ln Mean Nightlights" "RWI" "EWD")


* Table A8.2: Main Model Replications: State Type - 0.25 degree grid cells
reg ln_Agg_Acled_pre2013 i.Polity_Type_8hr   $pretreatment $posttreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid1dg_id) 
	est store ln_agAcled
	estadd local  LL  "Yes"
reg ln_N_yrs_conflict_Acled_pre2013 i.Polity_Type_8hr   $pretreatment $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid1dg_id)
	est store ln_YrsAcled
	estadd local  LL  "Yes"
reg ln_N_Battles_State_pre2013 i.Polity_Type_8hr   $pretreatment $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid1dg_id)
	est store lnNBattle
	estadd local  LL  "Yes"
reg ln_N_StateConflicts_pre2013 i.Polity_Type_8hr   $pretreatment $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid1dg_id)
	est store lnNConflict
reg ln_N_yrs_Stateconflict_pre2013 i.Polity_Type_8hr   $pretreatment $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid1dg_id)
	est store lnYrsConflict
	estadd local  LL  "Yes"
	
reg nightlight_20132_mean i.Polity_Type_8hr  $pretreatment $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid1dg_id)
	est store Mean2013
	estadd local  LL  "Yes"
reg ln__mean2013  i.Polity_Type_8hr  $pretreatment $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid1dg_id)
	est store ln_Mean2013
	estadd local  LL  "Yes"
reg rwi  i.Polity_Type_8hr  $pretreatment $posttreatment_post2011  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid1dg_id)
	est store rwi
	estadd local  LL  "Yes"
reg EWI_Index  i.Polity_Type_8hr  $pretreatment $posttreatment_post2011  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid1dg_id)
	est store ewi
	estadd local  LL  "Yes"	
	estadd local  CN  "Yes"	
			
esttab ln_agAcled ln_YrsAcled lnNBattle lnNConflict lnYrsConflict Mean2013 ln_Mean2013 rwi ewi using "Data/Table Output/Type_25deg.tex", replace ///
	scalars(r2 "Geo Coords" "CN Pretreatment Vars") modelwidth(2) se b(3) star (* 0.1 ** 0.05 *** 0.001) drop(grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Main Model Replications: Type Centralization - 25 degree grid cells"\label{Type_25deg}) nonumbers compress  ///
	mtitles("ln Acled Battles" "ln ACLED Yrs Conflict" "ln UCDP Battles" "ln # UCDP Conflicts" "ln UCDP Yrs Conflict" "Mean Nightlights" "ln Mean Nightlights" "RWI" "EWD")

	
* Table A8.3: Main Model Replications: Base Statehood - 0.55 degree grid cells
use "Data/Appendix/Larger Grids/FINAL_CLIPPED_55degrees.dta", clear

gen ln_CHIRPS_Prec_mm = log(0.001+CHIRPS_Prec_mm)
label var ln_CHIRPS_Prec_mm "ln Prec (mm)"

drop if Counterfactual_55 == 0

reg ln_Agg_Acled_pre2013 Centralized_8hr     $pretreatment $posttreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid2dg_id) 
	est store ln_agAcled
	estadd local  LL  "Yes"
reg ln_N_yrs_conflict_Acled_pre2013 Centralized_8hr  $pretreatment $posttreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid2dg_id)
	est store ln_YrsAcled
	estadd local  LL  "Yes"
reg ln_N_Battles_State_pre2013 Centralized_8hr   $pretreatment $posttreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid2dg_id)
	est store lnNBattle
	estadd local  LL  "Yes"
reg ln_N_StateConflicts_pre2013 Centralized_8hr   $pretreatment $posttreatment  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid2dg_id)
	est store lnNConflict
	estadd local  LL  "Yes"
reg ln_N_yrs_Stateconflict_pre2013 Centralized_8hr $pretreatment $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid2dg_id)
	est store lnYrsConflict
	estadd local  LL  "Yes"

reg nightlight_20132_mean Centralized_8hr $pretreatment $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid2dg_id)
	est store Mean2013
	estadd local  LL  "Yes"
reg ln_mean2013 Centralized_8hr $pretreatment $posttreatment c.grid_longitude#c.grid_latitude,   cluster(grid2dg_id)
	est store ln_Mean2013
	estadd local  LL  "Yes"
reg rwi Centralized_8hr $pretreatment $posttreatment_post2011  c.grid_longitude#c.grid_latitude,   cluster(grid2dg_id)
	est store rwi
	estadd local  LL  "Yes"
reg EWI_Index Centralized_8hr $pretreatment $posttreatment_post2011  c.grid_longitude#c.grid_latitude,   cluster(grid2dg_id)
	est store ewi
	estadd local  LL  "Yes"
	
esttab ln_agAcled  ln_YrsAcled  lnNBattle  lnNConflict  lnYrsConflict Mean2013  ln_Mean2013  rwi ewi using "Data/Table Output/BaseResults_55grid.tex", replace ///
	scalars(r2 "Geo Coords" "CN Pretreatment Vars") modelwidth(2) se b(3) star (* 0.1 ** 0.05 *** 0.001) drop(grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Main Model Replications: Base Centralization - 55 degree grid cells"\label{Base_55deg}) nonumbers compress  ///
	mtitles("ln Acled Battles" "ln ACLED Yrs Conflict" "ln UCDP Battles" "ln # UCDP Conflicts" "ln UCDP Yrs Conflict" "Mean Nightlights" "ln Mean Nightlights" "RWI" "EWD")


* Table A8.4: Main Model Replications: State Type - 0.55 degree grid cells
reg ln_Agg_Acled_pre2013 i.Polity_Type_8hr   $pretreatment $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid2dg_id) 
	est store ln_agAcled
	estadd local  LL  "Yes"
reg ln_N_yrs_conflict_Acled_pre2013 i.Polity_Type_8hr   $pretreatment $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid2dg_id)
	est store ln_YrsAcled
	estadd local  LL  "Yes"
reg ln_N_Battles_State_pre2013 i.Polity_Type_8hr   $pretreatment $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid2dg_id)
	est store lnNBattle
	estadd local  LL  "Yes"
reg ln_N_StateConflicts_pre2013 i.Polity_Type_8hr   $pretreatment $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid2dg_id)
	est store lnNConflict
	estadd local  LL  "Yes"
reg ln_N_yrs_Stateconflict_pre2013 i.Polity_Type_8hr   $pretreatment $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid2dg_id)
	est store lnYrsConflict
	estadd local  LL  "Yes"
	
reg nightlight_20132_mean i.Polity_Type_8hr  $pretreatment $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid2dg_id)
	est store Mean2013
	estadd local  LL  "Yes"
reg ln_mean2013  i.Polity_Type_8hr  $pretreatment $posttreatment c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid2dg_id)
	est store ln_Mean2013
	estadd local  LL  "Yes"
reg rwi  i.Polity_Type_8hr  $pretreatment $posttreatment_post2011  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid2dg_id)
	est store rwi
	estadd local  LL  "Yes"
reg EWI_Index  i.Polity_Type_8hr  $pretreatment $posttreatment_post2011  c.grid_longitude##c.grid_latitude  grid_longitude2 grid_latitude2,   cluster(grid2dg_id)
	est store ewi
	estadd local  LL  "Yes"
		

esttab ln_agAcled ln_YrsAcled lnNBattle lnNConflict lnYrsConflict Mean2013 ln_Mean2013 rwi ewi using "Data/Table Output/Type_55deg.tex", replace ///
	scalars(r2 "Geo Coords" "CN Pretreatment Vars") modelwidth(2) se b(3) star (* 0.1 ** 0.05 *** 0.001) drop(grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Main Model Replications: Type Centralization - 55 degree grid cells"\label{Type_55deg}) nonumbers compress  ///
	mtitles("ln Acled Battles" "ln ACLED Yrs Conflict" "ln UCDP Battles" "ln # UCDP Conflicts" "ln UCDP Yrs Conflict" "Mean Nightlights" "ln Mean Nightlights" "RWI" "EWD")
}


** SECTION 9: Mechanisms: Extensions & Robustness
{
use "Data/APSR_Data_Final.dta", clear
sort grid_id
merge grid_id using "Data/Mechanisms/AB_Final.dta"
drop if _merge == 1

gen ln_CHIRPS_Prec_mm = log(0.001+CHIRPS_Prec_mm)
label var ln_CHIRPS_Prec_mm "ln Prec (mm)"

gen Local_Trust = (Trust_LG+TradLead_Trust)/2

global pretreatment ln_popdensity_0ad Eco_Diversity landsuitability ln_d_coast_km NaturalResources_Dummy grid_perc_h20 elevation Rugged_RuggednessFinal mt_binary_mean
global posttreatment_AB Urban Poverty Education Min_D_State_Indep ln_CHIRPS_Prec_mm malaria_2000 ln_D_Capital_AB_km 

d $pretreatment
d $posttreatment_AB 


* Table A9.2: Mechanisms: Evidence from the Afrobarometer - Full Results part 1
reg Vote_Pressure2 i.Polity_Type_8hr respAge age2 Female $pretreatment  $posttreatment_AB c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 grid_longitude grid_latitude i.Round , cluster(uniqueea)
	est store Vote1
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"
reg TradLead_Influence_Vote i.Polity_Type_8hr respAge age2 Female $pretreatment  $posttreatment_AB c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 grid_longitude grid_latitude i.Round , cluster(uniqueea)
	est store Vote2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"
reg  TradLead_StayOut_Politics i.Polity_Type_8hr respAge age2 Female $pretreatment $posttreatment_AB c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 grid_longitude grid_latitude i.Round , cluster(uniqueea)
	est store Vote3
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"

* Table A9.3: Mechanisms: Evidence from the Afrobarometer - Full Results part 2
reg Ethnic_Neighbors i.Polity_Type_8hr respAge age2 Female $pretreatment $posttreatment_AB c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 grid_longitude grid_latitude i.Round , cluster(uniqueea)
	est store tolerance1
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"
reg Leaders_Equal_v_Grp i.Polity_Type_8hr respAge age2 Female $pretreatment $posttreatment_AB c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 grid_longitude grid_latitude i.Round , cluster(uniqueea)
	est store tolerance2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"

reg Violence_justified i.Polity_Type_8hr respAge age2 Female $pretreatment $posttreatment_AB c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 grid_longitude grid_latitude i.Round , cluster(uniqueea)
	est store Violence1
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"
reg Used_Pol_Violence i.Polity_Type_8hr respAge age2 Female $pretreatment  $posttreatment_AB c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 grid_longitude grid_latitude i.Round , cluster(uniqueea)
	est store Violence2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"
	
esttab tolerance1 tolerance2  Violence1 Violence2  using "Data/Table Output/Mech_AB_Full.tex", replace ///
	scalars(r2 "Geo Coordinates" "CN Pretreatment controls" "DM Demographic controls") modelwidth(2) se b(3) drop(_cons grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	star(* 0.10 ** 0.05 *** 0.001) label title("Mechanisms: Evidence from the Afrobarometer"\label{Mech_ABFull1}) nonumbers compress  ///
	mtitles("Like Non-Co-Ethnic Neighbors" "Leaders Favor Own Group" "Pol Violence Justified" "Used Pol Violence")

esttab Vote1 Vote2 Vote3  using "Data/Table Output/Mech_AB_Full2.tex", replace ///
	scalars(r2 "Geo Coordinates" "CN Pretreatment controls" "DM Demographic controls") modelwidth(2) se b(3) drop(_cons grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	star(* 0.10 ** 0.05 *** 0.001) label title("Mechanisms: Evidence from the Afrobarometer"\label{Mech_ABFull2}) nonumbers compress  ///
	mtitles("Vote Pressure" "Trad Leaders Influence Vote" "Trad Leaders Should Stay Out of Politics")


* Table A9.4: Mechanisms: Evidence from the Afrobarometer - Pretreatment Controls Only
reg Vote_Pressure2 i.Polity_Type_8hr respAge age2 Female $pretreatment  c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 grid_longitude grid_latitude i.Round , cluster(uniqueea)
	est store Vote1
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"
reg TradLead_Influence_Vote i.Polity_Type_8hr respAge age2 Female $pretreatment  c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 grid_longitude grid_latitude i.Round , cluster(uniqueea)
	est store Vote2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"
reg  TradLead_StayOut_Politics i.Polity_Type_8hr respAge age2 Female $pretreatment c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 grid_longitude grid_latitude i.Round , cluster(uniqueea)
	est store Vote3
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"
reg Ethnic_Neighbors i.Polity_Type_8hr respAge age2 Female $pretreatment c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 grid_longitude grid_latitude i.Round , cluster(uniqueea)
	est store tolerance1
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"
reg Leaders_Equal_v_Grp i.Polity_Type_8hr respAge age2 Female $pretreatment c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 grid_longitude grid_latitude i.Round , cluster(uniqueea)
	est store tolerance2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"
reg Violence_justified i.Polity_Type_8hr respAge age2 Female $pretreatment c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 grid_longitude grid_latitude i.Round , cluster(uniqueea)
	est store Violence1
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"
reg Used_Pol_Violence i.Polity_Type_8hr respAge age2 Female $pretreatment  c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 grid_longitude grid_latitude i.Round , cluster(uniqueea)
	est store Violence2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"


esttab Vote1 Vote2 Vote3  tolerance1 tolerance2 Violence1 Violence2  using "Data/Table Output/Mech_AB_1pre.tex", replace ///
	scalars(r2 "Geo Coordinates" "CN Pretreatment controls" "DM Demographic controls") modelwidth(2) se b(3) drop(_cons respAge age2 Female $pretreatment  grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	star(* 0.10 ** 0.05 *** 0.001) label title("Mechanisms: Evidence from the Afrobarometer"\label{Mech_AB1}) nonumbers compress  ///
	mtitles("Vote Pressure" "Trad Leaders Influence Vote" "Trad Leaders Should Stay Out of Politics" "Like Non-Co-Ethnic Neighbors" "Leaders Favor Own Group" "Pol Violence Justified" "Used Pol Violence")


* Table A9.5: Mechanisms: Evidence from the Afrobarometer - Rural Respondents Only
reg Vote_Pressure2 i.Polity_Type_8hr respAge age2 Female $pretreatment $posttreatment_AB c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 grid_longitude grid_latitude i.Round  if Urban == 0, cluster(uniqueea)
	est store Vote1
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"
reg TradLead_Influence_Vote i.Polity_Type_8hr respAge age2 Female $pretreatment $posttreatment_AB c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 grid_longitude grid_latitude i.Round  if Urban == 0, cluster(uniqueea)
	est store Vote2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"
reg  TradLead_StayOut_Politics i.Polity_Type_8hr respAge age2 Female $pretreatment $posttreatment_AB c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 grid_longitude grid_latitude i.Round  if Urban == 0, cluster(uniqueea)
	est store Vote3
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"
reg Ethnic_Neighbors i.Polity_Type_8hr respAge age2 Female $pretreatment $posttreatment_AB c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 grid_longitude grid_latitude i.Round  if Urban == 0, cluster(uniqueea)
	est store tolerance1
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"
reg Leaders_Equal_v_Grp i.Polity_Type_8hr respAge age2 Female $pretreatment $posttreatment_AB c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 grid_longitude grid_latitude i.Round  if Urban == 0, cluster(uniqueea)
	est store tolerance2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"
reg Violence_justified i.Polity_Type_8hr respAge age2 Female $pretreatment $posttreatment_AB c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 grid_longitude grid_latitude i.Round  if Urban == 0, cluster(uniqueea)
	est store Violence1
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"
reg Used_Pol_Violence i.Polity_Type_8hr respAge age2 Female $pretreatment $posttreatment_AB c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 grid_longitude grid_latitude i.Round if Urban == 0 , cluster(uniqueea)
	est store Violence2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"
	
esttab Vote1 Vote2 Vote3  tolerance1 tolerance2 Violence1 Violence2  using "Data/Table Output/Mech_AB_1_rural.tex", replace ///
	scalars(r2 "Geo Coordinates" "CN Pretreatment controls" "DM Demographic controls") modelwidth(2) se b(3) drop(_cons respAge age2 Female $pretreatment $posttreatment_AB  grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	star(* 0.10 ** 0.05 *** 0.001) label title("Mechanisms: Evidence from the Afrobarometer"\label{Mech_AB1}) nonumbers compress  ///
	mtitles("Vote Pressure" "Trad Leaders Influence Vote" "Trad Leaders Should Stay Out of Politics" "Like Non-Co-Ethnic Neighbors" "Leaders Favor Own Group" "Pol Violence Justified" "Used Pol Violence")


* Table A9.6: Mechanisms: Comparative Out-Group Tolerance - Would You Like As Neighbors ...
reg Ethnic_Neighbors i.Polity_Type_8hr respAge age2 Female $pretreatment $posttreatment_AB c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 grid_longitude grid_latitude i.Round , cluster(uniqueea)
	est store tolerance1
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"
	
reg Religion_Neighbors i.Polity_Type_8hr respAge age2 Female $pretreatment $posttreatment_AB c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 grid_longitude grid_latitude i.Round , cluster(uniqueea)
	est store tolerance2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"
	
reg Immigrant_Neighbors i.Polity_Type_8hr respAge age2 Female $pretreatment $posttreatment_AB c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 grid_longitude grid_latitude i.Round , cluster(uniqueea)
	est store tolerance3
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"

reg Party_Neighbors i.Polity_Type_8hr respAge age2 Female $pretreatment $posttreatment_AB c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 grid_longitude grid_latitude i.Round , cluster(uniqueea)
	est store tolerance4
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"

esttab tolerance1 tolerance2 tolerance3 tolerance4 using "Data/Table Output/Mech_OutgroupTolerance.tex", replace ///
	scalars(r2 "Geo Coordinates" "CN Pretreatment Vars" "DM Posttreatment Vars") modelwidth(2) se b(3) star(* 0.1 ** 0.05 *** 0.001) drop(_cons respAge age2 Female  $pretreatment $posttreatment_AB  grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Mechanisms: Compartive Out-Group Tolerance?"\label{Mech_CompTolerance}) nonumbers compress  ///
	mtitles("Diff Ethnicity" "Diff. Religion" "Immigrants" "Diff. Party")

	
* Table A9.7: Mechanisms: Are Traditional Authorities More Accountable?
reg TradLead_Trust i.Polity_Type_8hr respAge age2 Female   $pretreatment $posttreatment_AB  c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 grid_longitude grid_latitude i.Round , cluster(uniqueea)
	est store TA1
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"
reg TradLead_Corrupt i.Polity_Type_8hr respAge age2 Female   $pretreatment $posttreatment_AB  c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 grid_longitude grid_latitude i.Round , cluster(uniqueea)
	est store TA2
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"
reg TradLead_Listen i.Polity_Type_8hr respAge age2 Female   $pretreatment $posttreatment_AB  c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 grid_longitude grid_latitude i.Round , cluster(uniqueea)
	est store TA3
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"
reg TradLead_Performance i.Polity_Type_8hr respAge age2 Female   $pretreatment $posttreatment_AB  c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 grid_longitude grid_latitude i.Round , cluster(uniqueea)
	est store TA4
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"
reg TradLead_ResolveDisputes i.Polity_Type_8hr respAge age2 Female   $pretreatment $posttreatment_AB  c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 grid_longitude grid_latitude i.Round , cluster(uniqueea)
	est store TA6
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"
reg TradLead_Influence_Disputes i.Polity_Type_8hr respAge age2 Female   $pretreatment $posttreatment_AB  c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 grid_longitude grid_latitude i.Round , cluster(uniqueea)
	est store TA7
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"
reg TradLead_ManageLand i.Polity_Type_8hr respAge age2 Female   $pretreatment $posttreatment_AB  c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 grid_longitude grid_latitude i.Round , cluster(uniqueea)
	est store TA8
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"
reg TradLead_Influence_Land i.Polity_Type_8hr respAge age2 Female   $pretreatment $posttreatment_AB  c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 grid_longitude grid_latitude i.Round , cluster(uniqueea)
	est store TA9
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"
reg TradLead_Coop_Elected i.Polity_Type_8hr respAge age2 Female   $pretreatment $posttreatment_AB c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2 grid_longitude grid_latitude i.Round , cluster(uniqueea)
	est store TA10
	estadd local  LL  "Yes"
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"

esttab TA1 TA2 TA3 TA4 TA6 TA7 TA8 TA9 TA10 using "Data/Table Output/Mech_Accountability.tex", replace ///
	scalars(r2 "Geo Coordinates" "CN Pretreatment Vars" "DM Posttreatment Vars") modelwidth(2) se b(3) star(* 0.1 ** 0.05 *** 0.001) drop(_cons respAge age2 Female  $pretreatment $posttreatment_AB  grid_longitude grid_latitude c.grid_longitude#c.grid_latitude grid_longitude2 grid_latitude2) ///
	label title("Mechanisms: Is this More Accountable Traditional Authorities?"\label{MechAccountability}) nonumbers compress  ///
	mtitles("Trust" "Corrupt" "Listens" "Performance" "Resolve Disputes" "Influence Dispute Res." "Manage land" "Influence Land" "Cooperate with Elected")


* Table A9.8: Mechanisms: Evidence from Cabinet Ministers & Presidents - Full Model Results
use "Data/APSR_Data_Final.dta", clear
sort grid_id
merge grid_id using "Data/Mechanisms/PtP_Grid_Final.dta"
drop _merge

bys countryiso admname: egen type_mode=mode(Polity_Type_8hr)
bys countryiso admname: egen polity_max=max(Polity_8hr_ttl_area_km)

collapse (firstnm) type_mode (mean) Min_D_State_Indep Coded Centralized_8hr Eco_Diversity NaturalResources_Dummy ln_popdensity_0ad CHIRPS_Prec_mm malaria_2000  ln_dist_capital_km_pre2011 ln_d_coast_km landsuitability popdensity_0ad  mt_binary_mean elevation Rugged_RuggednessFinal  (first) N_Coups Perc_missing Avg_N_Minister_Reg_exec   Perc_Yrs_Exec Perc_Yrs_Ministers   Avg_N_Ministers_yr_exec , by(countryiso admname)

drop if admname == ""
replace Perc_Yrs_Exec = 0 if Perc_Yrs_Exec == .
replace Perc_Yrs_Exec = . if Coded == 0

replace Perc_Yrs_Ministers = 0 if Perc_Yrs_Ministers == .
replace Perc_Yrs_Ministers = . if Coded == 0

replace Avg_N_Ministers_yr_exec = 0 if Avg_N_Ministers_yr_exec == .
replace Avg_N_Ministers_yr_exec = . if Coded == 0

replace Avg_N_Minister_Reg_exec = 0 if Avg_N_Minister_Reg_exec == .
replace Avg_N_Minister_Reg_exec = . if Coded == 0

gen Coup = 0
replace Coup = 1 if N_Coups > 0

replace Perc_Yrs_Exec = Perc_Yrs_Exec*100
replace Perc_Yrs_Ministers = Perc_Yrs_Ministers*100
gen Perc_N_Minister_Reg_exec = Avg_N_Minister_Reg_exec*100

label var landsuitability "Agr. Suit."
label var elevation "Elev."
label var Rugged_RuggednessFinal "Ruggedness"
label var mt_binary_mean "Mountainous"
label var malaria_2000 "Malaria Suit"
label var CHIRPS_Prec_mm "Prec (mm)"
label var NaturalResources_Dummy "Natural Resources"
label var ln_dist_capital_km_pre2011 "ln D Capital (km)"
label var ln_d_coast_km "ln D Coast (km)"
label var ln_popdensity_0ad "ln Pop Density 0AD"
label var Min_D_State_Indep "D State Independence"

gen ln_CHIRPS_Prec_mm = log(0.001+CHIRPS_Prec_mm)
label var ln_CHIRPS_Prec_mm "ln Prec (mm)"

global pretreatment2 ln_popdensity_0ad Eco_Diversity ln_d_coast_km NaturalResources_Dummy landsuitability elevation Rugged_RuggednessFinal mt_binary_mean

d $pretreatment2
	

reg Perc_Yrs_Exec i.type_mode $pretreatment2 $posttreatment , cluster(countryiso)
	est store Perc_Yrs_E_1
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"
logit Coup i.type_mode $pretreatment2 $posttreatment  , cluster(countryiso) or
	est store Coup1
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"
reg Perc_Yrs_Ministers i.type_mode $pretreatment2 $posttreatment, cluster(countryiso)
	est store Perc_Yrs_M_1
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"
reg Perc_N_Minister_Reg_exec i.type_mode $pretreatment2 $posttreatment  , cluster(countryiso)
	est store Avg_N_reg1
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"
reg Avg_N_Ministers_yr_exec i.type_mode $pretreatment2 $posttreatment  , cluster(countryiso)
	est store Avg_N_yr1
	estadd local  CN  "Yes"
	estadd local  DM  "Yes"

esttab Perc_Yrs_E_1  Perc_Yrs_M_1 Coup1  Avg_N_reg1  Avg_N_yr1   using "Data/Table Output/Mech_Bargaining_FullSample.tex", replace ///
	scalars(r2 "CN Pretreatment Vars" "DM Posttreatment Vars") modelwidth(2) se b(3) star (* 0.1 ** 0.05 *** 0.001)  ///
	label title("Mechanisms: Evidence from Cabinet Ministers - Full Results"\label{MinistersAllCountries}) nonumbers compress  ///
	mtitles("% Yrs Executive" "% Yrs Minister"  "Coup"   "Avg % Regions Under Exec" "Avg # Minister Under Exec" )
	

* Table A9.9: Mechanisms: Evidence from Cabinet Ministers & Presidents - Results from Countries
with 50% Missingness or Less
reg Perc_Yrs_Exec i.type_mode $pretreatment2  if Perc_missing < .51, cluster(countryiso)
	est store Perc_Yrs_E_1
	estadd local  CN  "+"
	estadd local  DM  "-"
reg Perc_Yrs_Exec i.type_mode $pretreatment2 $posttreatment if Perc_missing < .51, cluster(countryiso)
	est store Perc_Yrs_E_2
	estadd local  CN  "+"
	estadd local  DM  "+"
logit Coup i.type_mode $pretreatment2   if Perc_missing < .51, cluster(countryiso) or
	est store Coup1
	estadd local  CN  "+"
	estadd local  DM  "-"
logit Coup i.type_mode $pretreatment2 $posttreatment  if Perc_missing < .51, cluster(countryiso) or
	est store Coup2
	estadd local  CN  "+"
	estadd local  DM  "+"
reg Perc_Yrs_Ministers i.type_mode $pretreatment2   if Perc_missing < .51, cluster(countryiso)
	est store Perc_Yrs_M_1
	estadd local  CN  "+"
	estadd local  DM  "-"
reg Perc_Yrs_Ministers i.type_mode $pretreatment2 $posttreatment  if Perc_missing < .51, cluster(countryiso)
	est store Perc_Yrs_M_2
	estadd local  CN  "+"
	estadd local  DM  "+"
reg Perc_N_Minister_Reg_exec i.type_mode $pretreatment2   if Perc_missing < .51, cluster(countryiso)
	est store Avg_N_reg1
	estadd local  CN  "+"
	estadd local  DM  "-"
reg Perc_N_Minister_Reg_exec i.type_mode $pretreatment2 $posttreatment  if Perc_missing < .51, cluster(countryiso)
	est store Avg_N_reg2
	estadd local  CN  "+"
	estadd local  DM  "+"
reg Avg_N_Ministers_yr_exec i.type_mode $pretreatment2   if Perc_missing < .51, cluster(countryiso)
	est store Avg_N_yr1
	estadd local  CN  "+"
	estadd local  DM  "-"
reg Avg_N_Ministers_yr_exec i.type_mode $pretreatment2 $posttreatment  if Perc_missing < .51, cluster(countryiso)
	est store Avg_N_yr2
	estadd local  CN  "+"
	estadd local  DM  "+"
	
esttab Perc_Yrs_E_1 Perc_Yrs_E_2 Perc_Yrs_M_1 Perc_Yrs_M_2  Coup1 Coup2  Avg_N_reg1 Avg_N_reg2 Avg_N_yr1 Avg_N_yr2 using "Data/Table Output/Mech_Bargaining_Missingness.tex", replace ///
	scalars(r2 "CN Pretreatment Vars" "DM Posttreatment Vars") modelwidth(2) se b(3) star (* 0.1 ** 0.05 *** 0.001)  ///
	label title("Mechanisms: Evidence from Cabinet Ministers - Full Results"\label{Ministers_SubSample}) nonumbers compress  ///
	mtitles("% Yrs Executive"  "% Yrs Minister"  "Coup"  "Avg % Regions Under Exec" "Avg # Minister Under Exec" )

}
